juju: github.com/juju/juju/environs/simplestreams/testing Index | Files

package testing

import "github.com/juju/juju/environs/simplestreams/testing"

Index

Package Files

stub.go testing.go

Constants

const (
    UnsignedJsonSuffix = ".json"
    SignedJsonSuffix   = ".sjson"
)
const (
    Index_v1   = "index:1.0"
    Product_v1 = "products:1.0"
    Mirror_v1  = "mirrors:1.0"
)

Variables

var PrivateKeyPassphrase = "12345"
var SignedMetadataPrivateKey = "" /* 1111 byte string literal not displayed */
var SignedMetadataPublicKey = "" /* 608 byte string literal not displayed */
var TestRoundTripper = &testing.ProxyRoundTripper{}

func AddSignedFiles Uses

func AddSignedFiles(c *gc.C, files map[string]string) map[string]string

func AssertExpectedSources Uses

func AssertExpectedSources(c *gc.C, obtained []simplestreams.DataSource, dsDetails []SourceDetails)

func NewTestConstraint Uses

func NewTestConstraint(params simplestreams.LookupParams) *testConstraint

func SetRoundTripperFiles Uses

func SetRoundTripperFiles(files map[string]string, errorFiles map[string]int)

func SignMetadata Uses

func SignMetadata(fileName string, fileData []byte) (string, []byte, error)

type LocalLiveSimplestreamsSuite Uses

type LocalLiveSimplestreamsSuite struct {
    testing.BaseSuite
    Source          simplestreams.DataSource
    RequireSigned   bool
    StreamsVersion  string
    DataType        string
    ValidConstraint simplestreams.LookupConstraint
}

func (*LocalLiveSimplestreamsSuite) AssertGetItemCollections Uses

func (s *LocalLiveSimplestreamsSuite) AssertGetItemCollections(c *gc.C, version string) *simplestreams.ItemCollection

func (*LocalLiveSimplestreamsSuite) AssertGetMetadata Uses

func (s *LocalLiveSimplestreamsSuite) AssertGetMetadata(c *gc.C) *simplestreams.CloudMetadata

func (*LocalLiveSimplestreamsSuite) GetIndexRef Uses

func (s *LocalLiveSimplestreamsSuite) GetIndexRef(format string) (*simplestreams.IndexReference, error)

func (*LocalLiveSimplestreamsSuite) IndexPath Uses

func (s *LocalLiveSimplestreamsSuite) IndexPath() string

func (*LocalLiveSimplestreamsSuite) SetUpSuite Uses

func (s *LocalLiveSimplestreamsSuite) SetUpSuite(c *gc.C)

func (*LocalLiveSimplestreamsSuite) TearDownSuite Uses

func (s *LocalLiveSimplestreamsSuite) TearDownSuite(c *gc.C)

func (*LocalLiveSimplestreamsSuite) TestGetCloudMetadataWithFormat Uses

func (s *LocalLiveSimplestreamsSuite) TestGetCloudMetadataWithFormat(c *gc.C)

func (*LocalLiveSimplestreamsSuite) TestGetIndex Uses

func (s *LocalLiveSimplestreamsSuite) TestGetIndex(c *gc.C)

func (*LocalLiveSimplestreamsSuite) TestGetIndexWrongFormat Uses

func (s *LocalLiveSimplestreamsSuite) TestGetIndexWrongFormat(c *gc.C)

func (*LocalLiveSimplestreamsSuite) TestGetProductsPathExists Uses

func (s *LocalLiveSimplestreamsSuite) TestGetProductsPathExists(c *gc.C)

func (*LocalLiveSimplestreamsSuite) TestGetProductsPathInvalidCloudSpec Uses

func (s *LocalLiveSimplestreamsSuite) TestGetProductsPathInvalidCloudSpec(c *gc.C)

func (*LocalLiveSimplestreamsSuite) TestGetProductsPathInvalidProductSpec Uses

func (s *LocalLiveSimplestreamsSuite) TestGetProductsPathInvalidProductSpec(c *gc.C)

type SourceDetails Uses

type SourceDetails struct {
    URL string
    Key string
}

SourceDetails stored some details that need to be checked about data source.

type StubDataSource Uses

type StubDataSource struct {
    testing.Stub

    DescriptionFunc      func() string
    FetchFunc            func(path string) (io.ReadCloser, string, error)
    URLFunc              func(path string) (string, error)
    PublicSigningKeyFunc func() string
    SetAllowRetryFunc    func(allow bool)
    PriorityFunc         func() int
    RequireSignedFunc    func() bool
}

func NewStubDataSource Uses

func NewStubDataSource() *StubDataSource

func (*StubDataSource) Description Uses

func (s *StubDataSource) Description() string

Description implements simplestreams.DataSource.

func (*StubDataSource) Fetch Uses

func (s *StubDataSource) Fetch(path string) (io.ReadCloser, string, error)

Description implements simplestreams.DataSource.

func (*StubDataSource) Priority Uses

func (s *StubDataSource) Priority() int

Description implements simplestreams.DataSource.

func (*StubDataSource) PublicSigningKey Uses

func (s *StubDataSource) PublicSigningKey() string

Description implements simplestreams.DataSource.

func (*StubDataSource) RequireSigned Uses

func (s *StubDataSource) RequireSigned() bool

Description implements simplestreams.DataSource.

func (*StubDataSource) SetAllowRetry Uses

func (s *StubDataSource) SetAllowRetry(allow bool)

Description implements simplestreams.DataSource.

func (*StubDataSource) URL Uses

func (s *StubDataSource) URL(path string) (string, error)

Description implements simplestreams.DataSource.

type TestDataSuite Uses

type TestDataSuite struct{}

func (*TestDataSuite) SetUpSuite Uses

func (s *TestDataSuite) SetUpSuite(c *gc.C)

func (*TestDataSuite) TearDownSuite Uses

func (s *TestDataSuite) TearDownSuite(c *gc.C)

type TestItem Uses

type TestItem struct {
    Id          string `json:"id"`
    Storage     string `json:"root_store"`
    VirtType    string `json:"virt"`
    Arch        string `json:"arch"`
    RegionAlias string `json:"crsn"`
    RegionName  string `json:"region"`
    Endpoint    string `json:"endpoint"`
}

Package testing imports 11 packages (graph) and is imported by 92 packages. Updated 2018-05-25. Refresh now. Tools for package owners.