本文整理汇总了Golang中gopkg/in/check/v1.C.Skip方法的典型用法代码示例。如果您正苦于以下问题:Golang C.Skip方法的具体用法?Golang C.Skip怎么用?Golang C.Skip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gopkg/in/check/v1.C
的用法示例。
在下文中一共展示了C.Skip方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestUsingTCPRemote
func (s *configFunctionalSuite) TestUsingTCPRemote(c *gc.C) {
if s.client == nil {
c.Skip("LXD not running locally")
}
// We can't just pass the testingCert as part of the Local connection,
// because Validate() doesn't like Local remotes that have
// Certificates.
lxdclient.PatchGenerateCertificate(&s.CleanupSuite, testingCert, testingKey)
cfg := lxdclient.Config{
Namespace: "my-ns",
Remote: lxdclient.Local,
}
nonlocal, err := cfg.UsingTCPRemote()
c.Assert(err, jc.ErrorIsNil)
checkValidRemote(c, &nonlocal.Remote)
c.Check(nonlocal, jc.DeepEquals, lxdclient.Config{
Namespace: "my-ns",
Remote: lxdclient.Remote{
Name: lxdclient.Local.Name,
Host: nonlocal.Remote.Host,
Cert: nonlocal.Remote.Cert,
Protocol: lxdclient.LXDProtocol,
ServerPEMCert: nonlocal.Remote.ServerPEMCert,
},
})
c.Check(nonlocal.Remote.Host, gc.Not(gc.Equals), "")
c.Check(nonlocal.Remote.Cert.CertPEM, gc.Not(gc.Equals), "")
c.Check(nonlocal.Remote.Cert.KeyPEM, gc.Not(gc.Equals), "")
c.Check(nonlocal.Remote.ServerPEMCert, gc.Not(gc.Equals), "")
// TODO(ericsnow) Check that the server has the certs.
}
示例2: SetUpSuite
func (s *charmsSuite) SetUpSuite(c *gc.C) {
// TODO(bogdanteleaga): Fix this on windows
if runtime.GOOS == "windows" {
c.Skip("bug 1403084: Skipping this on windows for now")
}
s.charmsCommonSuite.SetUpSuite(c)
}
示例3: TestBootstrapPropagatesEnvErrors
// In the case where we cannot examine an environment, we want the
// error to propagate back up to the user.
func (s *BootstrapSuite) TestBootstrapPropagatesEnvErrors(c *gc.C) {
//TODO(bogdanteleaga): fix this for windows once permissions are fixed
if runtime.GOOS == "windows" {
c.Skip("bug 1403084: this is very platform specific. When/if we will support windows state machine, this will probably be rewritten.")
}
const envName = "devenv"
env := resetJujuHome(c, envName)
defaultSeriesVersion := version.Current
defaultSeriesVersion.Series = config.PreferredSeries(env.Config())
// Force a dev version by having a non zero build number.
// This is because we have not uploaded any tools and auto
// upload is only enabled for dev versions.
defaultSeriesVersion.Build = 1234
s.PatchValue(&version.Current, defaultSeriesVersion)
s.PatchValue(&environType, func(string) (string, error) { return "", nil })
_, err := coretesting.RunCommand(c, envcmd.Wrap(&BootstrapCommand{}), "-e", envName)
c.Assert(err, jc.ErrorIsNil)
// Change permissions on the jenv file to simulate some kind of
// unexpected error when trying to read info from the environment
jenvFile := gitjujutesting.HomePath(".juju", "environments", envName+".jenv")
err = os.Chmod(jenvFile, os.FileMode(0200))
c.Assert(err, jc.ErrorIsNil)
// The second bootstrap should fail b/c of the propogated error
_, err = coretesting.RunCommand(c, envcmd.Wrap(&BootstrapCommand{}), "-e", envName)
c.Assert(err, gc.ErrorMatches, "there was an issue examining the environment: .*")
}
示例4: TestInstallMongodFallsBack
func (s *MongoSuite) TestInstallMongodFallsBack(c *gc.C) {
if runtime.GOOS == "windows" {
c.Skip("Skipping TestInstallMongodFallsBack as mongo is not installed on windows")
}
type installs struct {
series string
cmd string
}
tests := []installs{
{"precise", "mongodb-server"},
{"trusty", "juju-mongodb3.2\njuju-mongodb"},
{"wily", "juju-mongodb3.2\njuju-mongodb"},
{"xenial", "juju-mongodb3.2\njuju-mongodb"},
}
dataDir := c.MkDir()
outputFile := filepath.Join(dataDir, "apt-get-args")
testing.PatchExecutable(c, s, "apt-get", fmt.Sprintf(fakeInstallScript, outputFile))
for _, test := range tests {
c.Logf("Testing mongo install for series: %s", test.series)
s.patchSeries(test.series)
err := mongo.EnsureServer(makeEnsureServerParams(dataDir))
c.Assert(err, jc.ErrorIsNil)
args, err := ioutil.ReadFile(outputFile)
c.Assert(err, jc.ErrorIsNil)
c.Check(strings.TrimSpace(string(args)), gc.Equals, test.cmd)
err = os.Remove(outputFile)
c.Assert(err, jc.ErrorIsNil)
}
}
示例5: SetUpTest
func (s *lxcBrokerSuite) SetUpTest(c *gc.C) {
if runtime.GOOS == "windows" {
c.Skip("Skipping lxc tests on windows")
}
s.lxcSuite.SetUpTest(c)
var err error
s.agentConfig, err = agent.NewAgentConfig(
agent.AgentConfigParams{
Paths: agent.NewPathsWithDefaults(agent.Paths{DataDir: "/not/used/here"}),
Tag: names.NewMachineTag("1"),
UpgradedToVersion: jujuversion.Current,
Password: "dummy-secret",
Nonce: "nonce",
APIAddresses: []string{"10.0.0.1:1234"},
CACert: coretesting.CACert,
Model: coretesting.ModelTag,
})
c.Assert(err, jc.ErrorIsNil)
managerConfig := container.ManagerConfig{
container.ConfigName: "juju",
"log-dir": c.MkDir(),
"use-clone": "false",
}
s.api = NewFakeAPI()
s.broker, err = provisioner.NewLxcBroker(s.api, s.agentConfig, managerConfig, nil, false, 0)
c.Assert(err, jc.ErrorIsNil)
}
示例6: TestBadClientId
func (s *JujuCMainSuite) TestBadClientId(c *gc.C) {
if runtime.GOOS == "windows" {
c.Skip("issue 1403084: test panics on CryptAcquireContext on windows")
}
output := run(c, s.sockPath, "ben", 1, nil, "remote")
c.Assert(output, gc.Equals, "error: bad request: bad context: ben\n")
}
示例7: TestStdin
func (s *JujuCMainSuite) TestStdin(c *gc.C) {
if runtime.GOOS == "windows" {
c.Skip("issue 1403084: test panics on CryptAcquireContext on windows")
}
output := run(c, s.sockPath, "bill", 0, []byte("some standard input"), "remote")
c.Assert(output, gc.Equals, "some standard input")
}
示例8: SetUpTest
func (s *LibVertSuite) SetUpTest(c *gc.C) {
s.BaseSuite.SetUpTest(c)
// Skip if not linux
if runtime.GOOS != "linux" {
c.Skip("not running linux")
}
}
示例9: SetUpSuite
func (s *ContainerSetupSuite) SetUpSuite(c *gc.C) {
// TODO(bogdanteleaga): Fix this on windows
if runtime.GOOS == "windows" {
c.Skip("bug 1403084: Skipping container tests on windows")
}
s.CommonProvisionerSuite.SetUpSuite(c)
}
示例10: SetUpTest
func (s *syslogSuite) SetUpTest(c *gc.C) {
if runtime.GOOS != "linux" {
c.Skip(fmt.Sprintf("this test requires a controller, therefore does not support %q", runtime.GOOS))
}
currentSeries := series.HostSeries()
osFromSeries, err := series.GetOSFromSeries(currentSeries)
c.Assert(err, jc.ErrorIsNil)
if osFromSeries != os.Ubuntu {
c.Skip(fmt.Sprintf("this test requires a controller, therefore does not support OS %q only Ubuntu", osFromSeries.String()))
}
s.AgentSuite.SetUpTest(c)
// TODO(perrito666) 200160701:
// This needs to be done to stop the test from trying to install mongo
// while running, but it is a huge footprint for such little benefit.
// This test should not need JujuConnSuite or AgentSuite.
s.fakeEnsureMongo = agenttest.InstallFakeEnsureMongo(s)
done := make(chan struct{})
s.received = make(chan rfc5424test.Message)
addr := s.createSyslogServer(c, s.received, done)
// Leave log forwarding disabled initially, it will be enabled
// via a model config update in the test.
err = s.State.UpdateModelConfig(map[string]interface{}{
"syslog-host": addr,
"syslog-ca-cert": coretesting.CACert,
"syslog-client-cert": coretesting.ServerCert,
"syslog-client-key": coretesting.ServerKey,
}, nil, nil)
c.Assert(err, jc.ErrorIsNil)
s.logsCh, err = logsender.InstallBufferedLogWriter(1000)
c.Assert(err, jc.ErrorIsNil)
}
示例11: TestPrimaryOrLoopbackInterfacesAreSkipped
func (s *networkerSuite) TestPrimaryOrLoopbackInterfacesAreSkipped(c *gc.C) {
c.Skip("enable once the networker is enabled again")
// Reset what's considered up, so we can test eth0 and lo are not
// touched.
s.upInterfaces = make(set.Strings)
s.interfacesWithAddress = make(set.Strings)
nw, _ := s.newCustomNetworker(c, s.apiFacade, s.stateMachine.Id(), true, false)
defer worker.Stop(nw)
timeout := time.After(coretesting.LongWait)
for {
select {
case <-s.lastCommands:
if !s.vlanModuleLoaded {
// VLAN module loading commands is one of the first things
// the worker does, so if hasn't happened, we wait a bit more.
continue
}
c.Assert(s.upInterfaces.Contains("lo"), jc.IsFalse)
c.Assert(s.upInterfaces.Contains("eth0"), jc.IsFalse)
if s.upInterfaces.Contains("eth1") {
// If we run ifup eth1, we successfully skipped lo and
// eth0.
s.assertHaveConfig(c, nw, "", "eth0", "eth1", "eth1.42", "eth0.69")
return
}
case <-timeout:
c.Fatalf("commands expected but not executed")
}
}
}
示例12: TestDetectCredentialsNovarc
func (s *credentialsSuite) TestDetectCredentialsNovarc(c *gc.C) {
if runtime.GOOS != "linux" {
c.Skip("not running linux")
}
home := utils.Home()
dir := c.MkDir()
utils.SetHome(dir)
s.AddCleanup(func(*gc.C) {
utils.SetHome(home)
})
content := `
# Some secrets
export OS_TENANT_NAME=gary
EXPORT OS_USERNAME=bob
export OS_PASSWORD = dobbs
OS_REGION_NAME=region
`[1:]
novarc := filepath.Join(dir, ".novarc")
err := ioutil.WriteFile(novarc, []byte(content), 0600)
credentials, err := s.provider.DetectCredentials()
c.Assert(err, jc.ErrorIsNil)
c.Assert(credentials.DefaultRegion, gc.Equals, "region")
expected := cloud.NewCredential(
cloud.UserPassAuthType, map[string]string{
"username": "bob",
"password": "dobbs",
"tenant-name": "gary",
"domain-name": "",
},
)
expected.Label = `openstack region "region" project "gary" user "bob"`
c.Assert(credentials.AuthCredentials["bob"], jc.DeepEquals, expected)
}
示例13: TestOneSidedRidiculous
func (s *MemReconSuite) TestOneSidedRidiculous(c *gc.C) {
if !*long {
c.Skip("long running test")
}
s.RunOneSided(c, 150000, true, 300*time.Second)
s.RunOneSided(c, 150000, false, 300*time.Second)
}
示例14: SetUpTest
func (s *RebootSuite) SetUpTest(c *gc.C) {
if testing.GOVERSION < 1.3 {
c.Skip("skipping test, lxd requires Go 1.3 or later")
}
s.JujuConnSuite.SetUpTest(c)
testing.PatchExecutableAsEchoArgs(c, s, rebootBin)
s.PatchEnvironment("TEMP", c.MkDir())
s.tmpDir = c.MkDir()
s.rebootScriptName = "juju-reboot-script"
s.PatchValue(reboot.TmpFile, func() (*os.File, error) {
script := s.rebootScript(c)
return os.Create(script)
})
s.mgoInst.EnableAuth = true
err := s.mgoInst.Start(coretesting.Certs)
c.Assert(err, jc.ErrorIsNil)
configParams := agent.AgentConfigParams{
Paths: agent.Paths{DataDir: c.MkDir()},
Tag: names.NewMachineTag("0"),
UpgradedToVersion: jujuversion.Current,
StateAddresses: []string{s.mgoInst.Addr()},
CACert: coretesting.CACert,
Password: "fake",
Model: s.State.ModelTag(),
MongoVersion: mongo.Mongo24,
}
s.st, _ = s.OpenAPIAsNewMachine(c)
s.acfg, err = agent.NewAgentConfig(configParams)
c.Assert(err, jc.ErrorIsNil)
}
示例15: setUpTest
func (s *syncSuite) setUpTest(c *gc.C) {
if runtime.GOOS == "windows" {
c.Skip("issue 1403084: Currently does not work because of jujud problems")
}
s.FakeJujuXDGDataHomeSuite.SetUpTest(c)
s.ToolsFixture.SetUpTest(c)
// It's important that this be v1.8.x to match the test data.
s.PatchValue(&jujuversion.Current, version.MustParse("1.8.3"))
// Create a source storage.
baseDir := c.MkDir()
stor, err := filestorage.NewFileStorageWriter(baseDir)
c.Assert(err, jc.ErrorIsNil)
s.storage = stor
// Create a local tools directory.
s.localStorage = c.MkDir()
// Populate both local and default tools locations with the public tools.
versionStrings := make([]string, len(vAll))
for i, vers := range vAll {
versionStrings[i] = vers.String()
}
toolstesting.MakeTools(c, baseDir, "released", versionStrings)
toolstesting.MakeTools(c, s.localStorage, "released", versionStrings)
// Switch the default tools location.
baseURL, err := s.storage.URL(storage.BaseToolsPath)
c.Assert(err, jc.ErrorIsNil)
s.PatchValue(&envtools.DefaultBaseURL, baseURL)
}