X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f2788dd5fc3ef725969d6c0fcc4ddee3754829fc..e44725a3792df227f189f88ffb2cd1dbf0e93489:/lib/dispatchcloud/worker/pool_test.go diff --git a/lib/dispatchcloud/worker/pool_test.go b/lib/dispatchcloud/worker/pool_test.go index 7b5634605f..8d2ba09ebe 100644 --- a/lib/dispatchcloud/worker/pool_test.go +++ b/lib/dispatchcloud/worker/pool_test.go @@ -78,7 +78,7 @@ func (suite *PoolSuite) TestResumeAfterRestart(c *check.C) { driver := &test.StubDriver{} instanceSetID := cloud.InstanceSetID("test-instance-set-id") - is, err := driver.InstanceSet(nil, instanceSetID, nil, suite.logger) + is, err := driver.InstanceSet(nil, instanceSetID, nil, suite.logger, nil) c.Assert(err, check.IsNil) newExecutor := func(cloud.Instance) Executor { @@ -157,7 +157,7 @@ func (suite *PoolSuite) TestResumeAfterRestart(c *check.C) { func (suite *PoolSuite) TestDrain(c *check.C) { driver := test.StubDriver{} - instanceSet, err := driver.InstanceSet(nil, "test-instance-set-id", nil, suite.logger) + instanceSet, err := driver.InstanceSet(nil, "test-instance-set-id", nil, suite.logger, nil) c.Assert(err, check.IsNil) ac := arvados.NewClientFromEnv() @@ -210,7 +210,7 @@ func (suite *PoolSuite) TestDrain(c *check.C) { func (suite *PoolSuite) TestNodeCreateThrottle(c *check.C) { driver := test.StubDriver{HoldCloudOps: true} - instanceSet, err := driver.InstanceSet(nil, "test-instance-set-id", nil, suite.logger) + instanceSet, err := driver.InstanceSet(nil, "test-instance-set-id", nil, suite.logger, nil) c.Assert(err, check.IsNil) type1 := test.InstanceType(1) @@ -250,7 +250,7 @@ func (suite *PoolSuite) TestNodeCreateThrottle(c *check.C) { func (suite *PoolSuite) TestCreateUnallocShutdown(c *check.C) { driver := test.StubDriver{HoldCloudOps: true} - instanceSet, err := driver.InstanceSet(nil, "test-instance-set-id", nil, suite.logger) + instanceSet, err := driver.InstanceSet(nil, "test-instance-set-id", nil, suite.logger, nil) c.Assert(err, check.IsNil) type1 := arvados.InstanceType{Name: "a1s", ProviderType: "a1.small", VCPUs: 1, RAM: 1 * GiB, Price: .01} @@ -266,6 +266,7 @@ func (suite *PoolSuite) TestCreateUnallocShutdown(c *check.C) { type2.Name: type2, type3.Name: type3, }, + instanceInitCommand: "echo 'instance init command goes here'", } notify := pool.Subscribe() defer pool.Unsubscribe(notify) @@ -294,6 +295,9 @@ func (suite *PoolSuite) TestCreateUnallocShutdown(c *check.C) { return len(pool.workers) == 4 }) + vms := instanceSet.(*test.StubInstanceSet).StubVMs() + c.Check(string(vms[0].InitCommand), check.Matches, `umask 0177 && echo -n "[0-9a-f]+" >/var/run/arvados-instance-secret\necho 'instance init command goes here'`) + // Place type3 node on admin-hold ivs := suite.instancesByType(pool, type3) c.Assert(ivs, check.HasLen, 1)