func testUnits(t *testing.T, job jobs.Job, cl cluster.Cluster, expectedUnitNames []string, testName string) { fleet.FixedPwhashSalt = "test-salt" config := render.RenderConfig{ Groups: nil, CurrentScalingGroup: 0, Cluster: cluster.Cluster{ DockerOptions: cluster.DockerOptions{ LoggingArgs: []string{"--log-driver=test"}, }, FleetOptions: cl.FleetOptions, }, } generator := fleet.NewGenerator(job, config) ctx := &renderContext{ projectName: "testproject", projectVersion: "test-version", projectBuild: "test-build", } docker.SetupImages(docker.Images{ VaultMonkey: "pulcy/vault-monkey:latest", Wormhole: "pulcy/wormhole:latest", Alpine: "alpine:3.3", CephVolume: "pulcy/ceph-volume:latest", }) units, err := generator.GenerateUnits(ctx, cl.InstanceCount) if err != nil { t.Fatalf("GenerateUnits failed for instance-count %d: %#v", cl.InstanceCount, maskAny(err)) } compareUnitNames(t, expectedUnitNames, units) compareUnitFiles(t, units, filepath.Join(fixtureDir, "units", fmt.Sprintf("instance-count-%d", cl.InstanceCount), testName)) }
func init() { docker.SetupImages(docker.Images{ VaultMonkey: "pulcy/vault-monkey:latest", Wormhole: "pulcy/wormhole:latest", Alpine: "alpine:3.3", CephVolume: "pulcy/ceph-volume:latest", }) log = logging.MustGetLogger(projectName) cmdMain.PersistentFlags().BoolVarP(&globalFlags.debug, "debug", "D", false, "Print debug output") cmdMain.PersistentFlags().BoolVarP(&globalFlags.verbose, "verbose", "v", false, "Print verbose output") cmdMain.PersistentFlags().StringVar(&globalFlags.logLevel, "log-level", defaultLogLevel, "Log level (debug|info|warning|error)") cmdMain.PersistentFlags().StringVar(&globalFlags.fleetLogLevel, "fleet-log-level", "", "Log level of the fleet tunnel (debug|info|warning|error)") }