func (s *lxcBrokerSuite) TestSetupRoutesAndIPTablesAddsRuleIfMissing(c *gc.C) { // Isolate the test from the host machine. Because PatchExecutable // does not allow us to assert on subsequent executions of the // same binary, we need to replace the iptables commands with // separate ones. The check returns code=1 to trigger calling // add. fakeptablesRules := map[string]provisioner.IptablesRule{ "IPTablesSNAT": { "nat", "POSTROUTING", "{{.HostIF}} {{.HostIP}}", }, } s.PatchValue(provisioner.IptablesRules, fakeptablesRules) gitjujutesting.PatchExecutableAsEchoArgs(c, s, "iptables", 1, 0) gitjujutesting.PatchExecutableAsEchoArgs(c, s, "ip") ifaceInfo := []network.InterfaceInfo{{ Address: network.NewAddress("0.1.2.3"), }} addr := network.NewAddress("0.1.2.1") err := provisioner.SetupRoutesAndIPTables("nic", addr, "bridge", ifaceInfo, false) c.Assert(err, jc.ErrorIsNil) // Now verify the expected commands - since check returns 1, add // will be called before ip route add. gitjujutesting.AssertEchoArgs(c, "iptables", "-t", "nat", "-C", "POSTROUTING", "nic", "0.1.2.1") gitjujutesting.AssertEchoArgs(c, "iptables", "-t", "nat", "-I", "POSTROUTING", "1", "nic", "0.1.2.1") gitjujutesting.AssertEchoArgs(c, "ip", "route", "add", "0.1.2.3", "dev", "bridge") }
func (s *MongoSuite) TestInstallSuccessMongodCentOS(c *gc.C) { type installs struct { series string pkg string } test := installs{ "centos7", "mongodb*", } testing.PatchExecutableAsEchoArgs(c, s, "yum") testing.PatchExecutableAsEchoArgs(c, s, "chcon") testing.PatchExecutableAsEchoArgs(c, s, "semanage") dataDir := c.MkDir() s.patchSeries(test.series) err := mongo.EnsureServer(makeEnsureServerParams(dataDir)) c.Assert(err, jc.ErrorIsNil) expected := append(expectedArgs.YumBase, "epel-release") testing.AssertEchoArgs(c, "yum", expected...) testing.AssertEchoArgs(c, "chcon", expectedArgs.Chcon...) testing.AssertEchoArgs(c, "semanage", expectedArgs.Semanage...) }
func (s *MongoSuite) TestAddPPAInQuantal(c *gc.C) { testing.PatchExecutableAsEchoArgs(c, s, "apt-get") testing.PatchExecutableAsEchoArgs(c, s, "add-apt-repository") s.patchSeries("quantal") dataDir := c.MkDir() err := mongo.EnsureServer(makeEnsureServerParams(dataDir)) c.Assert(err, jc.ErrorIsNil) pack := [][]string{ { "install", "python-software-properties", }, { "install", "--target-release", "mongodb-server", }, } noCommand := len(expectedArgs.AptGetBase) - 1 for k := range pack { cmd := append(expectedArgs.AptGetBase[:noCommand], pack[k]...) testing.AssertEchoArgs(c, "apt-get", cmd...) } match := []string{ "--yes", "\"ppa:juju/stable\"", } testing.AssertEchoArgs(c, "add-apt-repository", match...) }
func (s *MongoSuite) TestInstallMongod(c *gc.C) { type installs struct { series string cmd [][]string } tests := []installs{ {"precise", [][]string{{"--target-release", "precise-updates/cloud-tools", "mongodb-server"}}}, {"quantal", [][]string{{"python-software-properties"}, {"--target-release", "mongodb-server"}}}, {"raring", [][]string{{"--target-release", "mongodb-server"}}}, {"saucy", [][]string{{"--target-release", "mongodb-server"}}}, {"trusty", [][]string{{"juju-mongodb"}}}, {"u-series", [][]string{{"juju-mongodb"}}}, } testing.PatchExecutableAsEchoArgs(c, s, "add-apt-repository") testing.PatchExecutableAsEchoArgs(c, s, "apt-get") for _, test := range tests { dataDir := c.MkDir() namespace := "namespace" + test.series s.patchSeries(test.series) err := mongo.EnsureServer(makeEnsureServerParams(dataDir, namespace)) c.Assert(err, jc.ErrorIsNil) for _, cmd := range test.cmd { match := append(expectedArgs.AptGetBase, cmd...) testing.AssertEchoArgs(c, "apt-get", match...) } } }
func (s *MongoSuite) TestInstallMongod(c *gc.C) { type installs struct { series string cmd [][]string } tests := []installs{ {"precise", [][]string{{"--target-release", "precise-updates/cloud-tools", "mongodb-server"}}}, {"trusty", [][]string{{"juju-mongodb3.2"}, {"juju-mongo-tools3.2"}}}, {"wily", [][]string{{"juju-mongodb3.2"}, {"juju-mongo-tools3.2"}}}, {"xenial", [][]string{{"juju-mongodb3.2"}, {"juju-mongo-tools3.2"}}}, } testing.PatchExecutableAsEchoArgs(c, s, "add-apt-repository") testing.PatchExecutableAsEchoArgs(c, s, "apt-get") for _, test := range tests { c.Logf("install for series %v", test.series) dataDir := c.MkDir() s.patchSeries(test.series) err := mongo.EnsureServer(makeEnsureServerParams(dataDir)) c.Assert(err, jc.ErrorIsNil) for _, cmd := range test.cmd { match := append(expectedArgs.AptGetBase, cmd...) testing.AssertEchoArgs(c, "apt-get", match...) } } }
func (s *InitialiserSuite) SetUpTest(c *gc.C) { s.BaseSuite.SetUpTest(c) s.calledCmds = []string{} s.PatchValue(&manager.RunCommandWithRetry, getMockRunCommandWithRetry(&s.calledCmds)) s.PatchValue(&configureLXDBridge, func() error { return nil }) s.PatchValue(&getLXDConfigSetter, func() (configSetter, error) { return &mockConfigSetter{}, nil }) // Fake the lxc executable for all the tests. testing.PatchExecutableAsEchoArgs(c, s, "lxc") testing.PatchExecutableAsEchoArgs(c, s, "lxd") }
func (s *RebootSuite) SetUpTest(c *gc.C) { var err error 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: version.Current, StateAddresses: []string{s.mgoInst.Addr()}, CACert: coretesting.CACert, Password: "******", Model: s.State.ModelTag(), } s.st, _ = s.OpenAPIAsNewMachine(c) s.acfg, err = agent.NewAgentConfig(configParams) c.Assert(err, jc.ErrorIsNil) }
func (s *cmdSuite) TestPatchExecutableNoArgs(c *gc.C) { s.EnsureArgFileRemoved(testFunc) testing.PatchExecutableAsEchoArgs(c, s, testFunc) output := runCommand(c, testFunc) c.Assert(output, gc.Equals, testFunc+"\n") testing.AssertEchoArgs(c, testFunc) }
func (s *MongoSuite) assertSuccessWithInstallStepFailCentOS(c *gc.C, exec []string, execNameFail string, returnCode int, expectedResult []jc.SimpleMessage) { type installs struct { series string pkg string } test := installs{ "centos7", "mongodb*", } for _, e := range exec { testing.PatchExecutableAsEchoArgs(c, s, e) } testing.PatchExecutableThrowError(c, s, execNameFail, returnCode) dataDir := c.MkDir() s.patchSeries(test.series) var tw loggo.TestWriter c.Assert(loggo.RegisterWriter("mongosuite", &tw, loggo.INFO), jc.ErrorIsNil) defer loggo.RemoveWriter("mongosuite") err := mongo.EnsureServer(makeEnsureServerParams(dataDir)) c.Assert(err, jc.ErrorIsNil) c.Assert(tw.Log(), jc.LogMatches, expectedResult) }
func (s *MongoSuite) TestQuantalAptAddRepo(c *gc.C) { dir := c.MkDir() // patch manager.RunCommandWithRetry for repository addition: s.PatchValue(&manager.RunCommandWithRetry, func(string) (string, int, error) { return "", 1, fmt.Errorf("packaging command failed: exit status 1") }) s.PatchEnvPathPrepend(dir) pm, err := coretesting.GetPackageManager() c.Assert(err, jc.ErrorIsNil) failCmd(filepath.Join(dir, pm.RepositoryManager)) testing.PatchExecutableAsEchoArgs(c, s, pm.PackageManager) var tw loggo.TestWriter c.Assert(loggo.RegisterWriter("test-writer", &tw, loggo.ERROR), jc.ErrorIsNil) defer loggo.RemoveWriter("test-writer") // test that we call add-apt-repository only for quantal // (and that if it fails, we log the error) s.patchSeries("quantal") err = mongo.EnsureServer(makeEnsureServerParams(dir)) c.Assert(err, jc.ErrorIsNil) c.Assert(tw.Log(), jc.LogMatches, []jc.SimpleMessage{ {loggo.ERROR, `cannot install/upgrade mongod \(will proceed anyway\): packaging command failed`}, }) s.PatchValue(&manager.RunCommandWithRetry, func(string) (string, int, error) { return "", 0, nil }) s.patchSeries("trusty") failCmd(filepath.Join(dir, "mongod")) err = mongo.EnsureServer(makeEnsureServerParams(dir)) c.Assert(err, jc.ErrorIsNil) }
// Test that the call to SyncImages utilizes the defined source func (s *LibVertSuite) TestSyncImagesUtilizesSimpleStreamsSource(c *gc.C) { const simpStreamsBinName = "uvt-simplestreams-libvirt" testing.PatchExecutableAsEchoArgs(c, s, simpStreamsBinName) const ( series = "mocked-series" arch = "mocked-arch" source = "mocked-url" ) err := kvm.SyncImages(series, arch, source) c.Assert(err, jc.ErrorIsNil) expectedArgs := strings.Split( fmt.Sprintf( "sync arch=%s release=%s --source=%s", arch, series, source, ), " ", ) testing.AssertEchoArgs(c, simpStreamsBinName, expectedArgs...) }
func (s *cmdSuite) TestPatchExecutableWithArgs(c *gc.C) { s.EnsureArgFileRemoved(testFunc) testing.PatchExecutableAsEchoArgs(c, s, testFunc) output := runCommand(c, testFunc, "foo", "bar baz") c.Assert(output, gc.Equals, testFunc+" \"foo\" \"bar baz\"\n") testing.AssertEchoArgs(c, testFunc, "foo", "bar baz") }
func (s *MongoSuite) testEnsureServerNumaCtl(c *gc.C, setNumaPolicy bool) string { dataDir := c.MkDir() dbDir := filepath.Join(dataDir, "db") pm, err := coretesting.GetPackageManager() c.Assert(err, jc.ErrorIsNil) testing.PatchExecutableAsEchoArgs(c, s, pm.PackageManager) testParams := makeEnsureServerParams(dataDir) testParams.SetNumaControlPolicy = setNumaPolicy err = mongo.EnsureServer(testParams) c.Assert(err, jc.ErrorIsNil) testJournalDirs(dbDir, c) assertInstalled := func() { installed := s.data.Installed() c.Assert(installed, gc.HasLen, 1) service := installed[0] c.Assert(service.Name(), gc.Equals, "juju-db") c.Assert(service.Conf().Desc, gc.Equals, "juju state database") if setNumaPolicy { stripped := strings.Replace(service.Conf().ExtraScript, "\n", "", -1) c.Assert(stripped, gc.Matches, `.* sysctl .*`) } else { c.Assert(service.Conf().ExtraScript, gc.Equals, "") } c.Assert(service.Conf().ExecStart, gc.Matches, `.*/mongod.*`) c.Assert(service.Conf().Logfile, gc.Equals, "") } assertInstalled() return dataDir }
func (s *KVMSuite) TestStartContainerUtilizesSimpleStream(c *gc.C) { const libvirtBinName = "uvt-simplestreams-libvirt" testing.PatchExecutableAsEchoArgs(c, s, libvirtBinName) startParams := kvm.StartParams{ Series: "mocked-series", Arch: "mocked-arch", ImageDownloadUrl: "mocked-url", } mockedContainer := kvm.NewEmptyKvmContainer() mockedContainer.Start(startParams) expectedArgs := strings.Split( fmt.Sprintf( "sync arch=%s release=%s --source=%s", startParams.Arch, startParams.Series, startParams.ImageDownloadUrl, ), " ", ) testing.AssertEchoArgs(c, libvirtBinName, expectedArgs...) }
func (s *KVMSuite) TestCreateMachineUsesTemplate(c *gc.C) { const uvtKvmBinName = "uvt-kvm" testing.PatchExecutableAsEchoArgs(c, s, uvtKvmBinName) tempDir := c.MkDir() params := kvm.CreateMachineParams{ Hostname: "foo-bar", NetworkBridge: "br0", Interfaces: []network.InterfaceInfo{ {MACAddress: "00:16:3e:20:b0:11"}, }, UserDataFile: filepath.Join(tempDir, "something"), } err := kvm.CreateMachine(params) c.Assert(err, jc.ErrorIsNil) expectedArgs := []string{ "create", "--log-console-output", "--user-data", filepath.Join(tempDir, "something"), "--template", filepath.Join(tempDir, "kvm-template.xml"), "foo-bar", } testing.AssertEchoArgs(c, uvtKvmBinName, expectedArgs...) }
func (s *mainSuite) TestRunAsRootCallsSudoIfNotRoot(c *gc.C) { s.PatchValue(local.CheckIfRoot, func() bool { return false }) testing.PatchExecutableAsEchoArgs(c, s, "sudo") // the command needs to be in the path... testing.PatchExecutableAsEchoArgs(c, s, "juju-magic") magicPath, err := exec.LookPath("juju-magic") c.Assert(err, gc.IsNil) callIgnored := func(*cmd.Context) error { panic("unreachable") } args := []string{"passed"} context := coretesting.Context(c) err = local.RunAsRoot("juju-magic", args, context, callIgnored) c.Assert(err, gc.IsNil) expected := fmt.Sprintf("sudo \"--preserve-env\" %q \"passed\"\n", magicPath) c.Assert(coretesting.Stdout(context), gc.Equals, expected) }
func (s *cmdSuite) TestPatchExecutableWithArgs(c *gc.C) { s.EnsureArgFileRemoved(testFunc) testing.PatchExecutableAsEchoArgs(c, s, testFunc) output := runCommand(c, testFunc, "foo", "bar baz") output = strings.TrimRight(output, "\r\n") c.Assert(output, gc.DeepEquals, testFunc+" 'foo' 'bar baz'") testing.AssertEchoArgs(c, testFunc, "foo", "bar baz") }
func (s *mainSuite) TestRunAsRootCallsSudoIfNotRoot(c *gc.C) { if runtime.GOOS == "windows" { c.Skip("No root on windows") } s.PatchValue(local.CheckIfRoot, func() bool { return false }) testing.PatchExecutableAsEchoArgs(c, s, "sudo") // the command needs to be in the path... testing.PatchExecutableAsEchoArgs(c, s, "juju-magic") magicPath, err := exec.LookPath("juju-magic") c.Assert(err, jc.ErrorIsNil) callIgnored := func(*cmd.Context) error { panic("unreachable") } args := []string{"passed"} context := coretesting.Context(c) err = local.RunAsRoot("juju-magic", args, context, callIgnored) c.Assert(err, jc.ErrorIsNil) expected := fmt.Sprintf("sudo '--preserve-env' '%s' 'passed'", magicPath) c.Assert(strings.TrimRight(coretesting.Stdout(context), "\r\n"), gc.Equals, expected) }
func (s *MongoSuite) TestInstallMongodServiceExists(c *gc.C) { pm, err := coretesting.GetPackageManager() c.Assert(err, jc.ErrorIsNil) testing.PatchExecutableAsEchoArgs(c, s, pm.PackageManager) if pm.PackageManager == "yum" { testing.PatchExecutableAsEchoArgs(c, s, "chcon") testing.PatchExecutableAsEchoArgs(c, s, "semanage") } dataDir := c.MkDir() s.data.SetStatus(mongo.ServiceName, "running") s.data.SetErrors(nil, nil, nil, errors.New("shouldn't be called")) err = mongo.EnsureServer(makeEnsureServerParams(dataDir)) c.Assert(err, jc.ErrorIsNil) c.Check(s.data.Installed(), gc.HasLen, 0) s.data.CheckCallNames(c, "Installed", "Exists", "Running") }
func (s *cmdSuite) TestPatchExecutableWithArgs(c *gc.C) { s.EnsureArgFileRemoved(testFunc) testing.PatchExecutableAsEchoArgs(c, s, testFunc) output := runCommand(c, testFunc, "foo", "bar baz") switch runtime.GOOS { case "windows": c.Assert(output, gc.Equals, testFunc+" \"foo\" \"bar baz\"\r\n") default: c.Assert(output, gc.Equals, testFunc+" \"foo\" \"bar baz\"\n") } testing.AssertEchoArgs(c, testFunc, "foo", "bar baz") }
func (s *MongoSuite) TestAddEpelInCentOS(c *gc.C) { testing.PatchExecutableAsEchoArgs(c, s, "yum") s.patchSeries("centos7") testing.PatchExecutableAsEchoArgs(c, s, "chcon") testing.PatchExecutableAsEchoArgs(c, s, "semanage") dataDir := c.MkDir() err := mongo.EnsureServer(makeEnsureServerParams(dataDir, "")) c.Assert(err, jc.ErrorIsNil) expectedEpelRelease := append(expectedArgs.YumBase, "epel-release") testing.AssertEchoArgs(c, "yum", expectedEpelRelease...) expectedMongodbServer := append(expectedArgs.YumBase, "mongodb-server") testing.AssertEchoArgs(c, "yum", expectedMongodbServer...) testing.AssertEchoArgs(c, "chcon", expectedArgs.Chcon...) testing.AssertEchoArgs(c, "semanage", expectedArgs.Semanage...) }
func (s *adminSuite) TestEnsureAdminUser(c *gc.C) { inst := &gitjujutesting.MgoInstance{} err := inst.Start(coretesting.Certs) c.Assert(err, gc.IsNil) defer inst.DestroyWithLog() dialInfo := inst.DialInfo() // Mock out mongod, so the --noauth execution doesn't // do anything nasty. Also mock out the Signal method. gitjujutesting.PatchExecutableAsEchoArgs(c, s, "mongod") mongodDir := filepath.SplitList(os.Getenv("PATH"))[0] s.PatchValue(&mongo.JujuMongodPath, filepath.Join(mongodDir, "mongod")) s.PatchValue(mongo.ProcessSignal, func(*os.Process, os.Signal) error { return nil }) // First call succeeds, as there are no users yet. added, err := s.ensureAdminUser(c, dialInfo, "whomever", "whatever") c.Assert(err, gc.IsNil) c.Assert(added, jc.IsTrue) // EnsureAdminUser should have stopped the mongo service, // started a new mongod with --noauth, and then finally // started the service back up. c.Assert(s.serviceStarts, gc.Equals, 1) c.Assert(s.serviceStops, gc.Equals, 1) _, portString, err := net.SplitHostPort(dialInfo.Addrs[0]) c.Assert(err, gc.IsNil) gitjujutesting.AssertEchoArgs(c, "mongod", "--noauth", "--dbpath", "db", "--sslOnNormalPorts", "--sslPEMKeyFile", "server.pem", "--sslPEMKeyPassword", "ignored", "--bind_ip", "127.0.0.1", "--port", portString, "--noprealloc", "--syslog", "--smallfiles", "--journal", ) // Second call succeeds, as the admin user is already there. added, err = s.ensureAdminUser(c, dialInfo, "whomever", "whatever") c.Assert(err, gc.IsNil) c.Assert(added, jc.IsFalse) // There should have been no additional start/stop. c.Assert(s.serviceStarts, gc.Equals, 1) c.Assert(s.serviceStops, gc.Equals, 1) }
func (s *MongoSuite) TestNoMongoDir(c *gc.C) { // Make a non-existent directory that can nonetheless be // created. pm, err := coretesting.GetPackageManager() c.Assert(err, jc.ErrorIsNil) testing.PatchExecutableAsEchoArgs(c, s, pm.PackageManager) dataDir := filepath.Join(c.MkDir(), "dir", "data") err = mongo.EnsureServer(makeEnsureServerParams(dataDir)) c.Check(err, jc.ErrorIsNil) _, err = os.Stat(filepath.Join(dataDir, "db")) c.Assert(err, jc.ErrorIsNil) }
func (s *MongoSuite) TestEnsureServerServerExistsNotRunningStartError(c *gc.C) { dataDir := c.MkDir() pm, err := coretesting.GetPackageManager() c.Assert(err, jc.ErrorIsNil) testing.PatchExecutableAsEchoArgs(c, s, pm.PackageManager) s.data.SetStatus(mongo.ServiceName, "installed") failure := errors.New("won't start") s.data.SetErrors(nil, nil, nil, failure) // Installed, Exists, Running, Running, Start err = mongo.EnsureServer(makeEnsureServerParams(dataDir)) c.Check(errors.Cause(err), gc.Equals, failure) c.Check(s.data.Installed(), gc.HasLen, 0) s.data.CheckCallNames(c, "Installed", "Exists", "Running", "Start") }
func (s *MongoSuite) TestEnsureServerServerExistsNotRunningIsStarted(c *gc.C) { dataDir := c.MkDir() pm, err := coretesting.GetPackageManager() c.Assert(err, jc.ErrorIsNil) testing.PatchExecutableAsEchoArgs(c, s, pm.PackageManager) s.data.SetStatus(mongo.ServiceName, "installed") err = mongo.EnsureServer(makeEnsureServerParams(dataDir)) c.Assert(err, jc.ErrorIsNil) // These should still be written out even if the service was installed. s.assertSSLKeyFile(c, dataDir) s.assertSharedSecretFile(c, dataDir) s.assertMongoConfigFile(c) c.Check(s.data.Installed(), gc.HasLen, 0) s.data.CheckCallNames(c, "Installed", "Exists", "Running", "Start") }
func (s *MongoSuite) TestEnsureServerServerExistsAndRunning(c *gc.C) { dataDir := c.MkDir() namespace := "namespace" pm, err := coretesting.GetPackageManager() c.Assert(err, jc.ErrorIsNil) testing.PatchExecutableAsEchoArgs(c, s, pm.PackageManager) s.data.SetStatus(mongo.ServiceName(namespace), "running") s.data.SetErrors(nil, nil, nil, errors.New("shouldn't be called")) err = mongo.EnsureServer(makeEnsureServerParams(dataDir, namespace)) c.Assert(err, jc.ErrorIsNil) // These should still be written out even if the service was installed. s.assertSSLKeyFile(c, dataDir) s.assertSharedSecretFile(c, dataDir) s.assertMongoConfigFile(c) c.Check(s.data.Installed(), gc.HasLen, 0) s.data.CheckCallNames(c, "Installed", "Exists", "Running") }
func (s *SetIPAndARPForwardingSuite) TestSuccess(c *gc.C) { // NOTE: Because PatchExecutableAsEchoArgs does not allow us to // assert on earlier invocations of the same binary (each run // overwrites the last args used), we only check sysctl was called // for the second key (arpProxySysctlKey). We do check the config // contains both though. fakeConfig := filepath.Join(c.MkDir(), "sysctl.conf") testing.PatchExecutableAsEchoArgs(c, s, "sysctl") s.PatchValue(provisioner.SysctlConfig, fakeConfig) err := provisioner.SetIPAndARPForwarding(true) c.Assert(err, jc.ErrorIsNil) expectConf := fmt.Sprintf( "%s=1\n%s=1", provisioner.IPForwardSysctlKey, provisioner.ARPProxySysctlKey, ) AssertFileContains(c, fakeConfig, expectConf) expectKeyVal := fmt.Sprintf("%s=1", provisioner.IPForwardSysctlKey) testing.AssertEchoArgs(c, "sysctl", "-w", expectKeyVal) expectKeyVal = fmt.Sprintf("%s=1", provisioner.ARPProxySysctlKey) testing.AssertEchoArgs(c, "sysctl", "-w", expectKeyVal) err = provisioner.SetIPAndARPForwarding(false) c.Assert(err, jc.ErrorIsNil) expectConf = fmt.Sprintf( "%s=0\n%s=0", provisioner.IPForwardSysctlKey, provisioner.ARPProxySysctlKey, ) AssertFileContains(c, fakeConfig, expectConf) expectKeyVal = fmt.Sprintf("%s=0", provisioner.IPForwardSysctlKey) testing.AssertEchoArgs(c, "sysctl", "-w", expectKeyVal) expectKeyVal = fmt.Sprintf("%s=0", provisioner.ARPProxySysctlKey) testing.AssertEchoArgs(c, "sysctl", "-w", expectKeyVal) }