From 873a95fcdc0754243208d8d9e001a148c1a805ed Mon Sep 17 00:00:00 2001 From: Matthew Kocher Date: Wed, 19 Aug 2026 15:52:01 -0700 Subject: [PATCH 1/2] Run test-integration on bosh-cli-ci-image The job only used warden-cpi-image as a container to run a ginkgo suite -- nothing touched garden. Also drop the sshd startup: the ssh tunnel it was for is wired to mocks, and the manifest template the suite renders has no ssh_tunnel block, so the SSHTunnel* manifestContext fields were dead. --- ci/pipeline.yml | 5 ++--- ci/tasks/test-integration.sh | 3 --- integration/create_env_test.go | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 4a78afbdf8..8b5c608ecd 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -79,13 +79,12 @@ jobs: public: true plan: - in_parallel: - - get: warden-cpi-image + - get: bosh-cli-ci-image - get: bosh-cli trigger: true - task: test-integration file: bosh-cli/ci/tasks/test-integration.yml - image: warden-cpi-image - privileged: true + image: bosh-cli-ci-image - name: test-acceptance public: true diff --git a/ci/tasks/test-integration.sh b/ci/tasks/test-integration.sh index 87843b420f..af17a323c3 100755 --- a/ci/tasks/test-integration.sh +++ b/ci/tasks/test-integration.sh @@ -3,9 +3,6 @@ set -eu -o pipefail set -x -# For ssh tunnel test -/etc/init.d/ssh start - cd bosh-cli bin/clean # TODO: is this needed in CI? diff --git a/integration/create_env_test.go b/integration/create_env_test.go index 9356b461b2..88498e5dee 100644 --- a/integration/create_env_test.go +++ b/integration/create_env_test.go @@ -221,9 +221,7 @@ cloud_provider: -----END CERTIFICATE----- ` type manifestContext struct { - DiskSize int - SSHTunnelUser string - SSHTunnelPrivateKey string + DiskSize int } var updateManifest = func(context manifestContext) { From 46e8fdf9deffdf4202e13c4aff08d34f6db91be4 Mon Sep 17 00:00:00 2001 From: Matthew Kocher Date: Wed, 19 Aug 2026 23:36:38 -0700 Subject: [PATCH 2/2] Run test-acceptance on the docker CPI Replaces the warden CPI with the docker CPI: the task sources start-docker from the docker-cpi image instead of booting garden, and the create-env manifests target docker_cpi on the 10.245.0.0/16 network start-docker creates. Two things don't carry over from the warden setup. The local blobstore was a warden_cpi property; the docker CPI has no equivalent, and the agent exits at startup without one, so it moves to env.bosh.blobstores as bosh-deployment does. docker_host and docker_tls arrive via a vars file rather than -v flags because the suite shells out through bash -c, which mangles the multi-line TLS blob. Networks without a subnet now need a cloud_properties name, so the dynamic and vip networks each get one. --- acceptance/assets/manifest.yml | 48 +++++++++-------- .../manifest_with_all_network_types.yml | 52 +++++++++++-------- acceptance/assets/modified_manifest.yml | 48 +++++++++-------- acceptance/config.go | 8 +++ acceptance/instance_ssh.go | 6 +-- acceptance/lifecycle_test.go | 11 ++-- ...ith-garden => test-acceptance-with-docker} | 14 ++++- ci/pipeline.yml | 22 ++++---- ci/tasks/test-acceptance.sh | 14 +++-- ci/tasks/test-acceptance.yml | 2 +- docs/test.md | 30 ++++------- 11 files changed, 143 insertions(+), 112 deletions(-) rename bin/{test-acceptance-with-garden => test-acceptance-with-docker} (52%) diff --git a/acceptance/assets/manifest.yml b/acceptance/assets/manifest.yml index 71f3104a8d..3acdc252a6 100644 --- a/acceptance/assets/manifest.yml +++ b/acceptance/assets/manifest.yml @@ -2,7 +2,7 @@ name: test-release releases: -- name: bosh-warden-cpi +- name: bosh-docker-cpi url: {{ .CPIReleaseURL }} - name: sample-release url: file://{{ .DummyCompiledReleasePath }} @@ -17,8 +17,16 @@ resource_pools: cert: ((mbus)) authorized_keys: - ((ssh_tunnel.public_key)) + blobstores: + - provider: local + options: + blobstore_path: /var/vcap/micro_bosh/data/cache stemcell: url: {{ .StemcellURL }} + cloud_properties: + ports: + - 22/tcp # ssh_tunnel + - 6868/tcp # agent mbus disk_pools: - name: default @@ -28,39 +36,33 @@ networks: - name: fake-network-name type: manual subnets: - - range: 10.244.0.40/30 - gateway: 10.244.0.41 + # Carved out of the docker network created by start-docker (10.245.0.0/16). + - range: 10.245.0.40/30 + gateway: 10.245.0.41 dns: [8.8.8.8] cloud_properties: - subnet: fake-subnet + name: director_network cloud_provider: template: - name: warden_cpi - release: bosh-warden-cpi - mbus: https://admin:admin@10.244.0.42:6868 + name: docker_cpi + release: bosh-docker-cpi + mbus: https://admin:admin@10.245.0.42:6868 cert: ca: ((mbus.ca)) ssh_tunnel: - host: 10.244.0.42 + host: 10.245.0.42 port: 22 user: vcap private_key: ((ssh_tunnel.private_key)) properties: - warden_cpi: &warden_cpi - actions: - expand_stemcell_tarball: false - warden: - connect_network: tcp - connect_address: 0.0.0.0:7777 - network_pool: 10.244.0.0/16 - host_ip: 192.168.54.4 + docker_cpi: &docker_cpi + docker: + host: ((docker_host)) + tls: ((docker_tls)) agent: mbus: https://admin:admin@0.0.0.0:6868 - blobstore: - provider: local - options: - blobstore_path: /var/vcap/micro_bosh/data/cache + start_containers_with_systemd: true instance_groups: - name: dummy_instance_group @@ -71,10 +73,10 @@ instance_groups: resource_pool: fake-resource-pool-name networks: - name: fake-network-name - static_ips: [10.244.0.42] + static_ips: [10.245.0.42] persistent_disk_pool: default properties: - cpi: *warden_cpi + cpi: *docker_cpi dummy_with_properties: echo_value: "hi" ntp: [] @@ -88,7 +90,7 @@ variables: type: certificate options: common_name: bosh.integration.test - alternative_names: [10.244.0.42] + alternative_names: [10.245.0.42] ca: default_ca - name: ssh_tunnel type: ssh diff --git a/acceptance/assets/manifest_with_all_network_types.yml b/acceptance/assets/manifest_with_all_network_types.yml index 3e731f2e81..712d770c38 100644 --- a/acceptance/assets/manifest_with_all_network_types.yml +++ b/acceptance/assets/manifest_with_all_network_types.yml @@ -2,7 +2,7 @@ name: test-release releases: -- name: bosh-warden-cpi +- name: bosh-docker-cpi url: {{ .CPIReleaseURL }} - name: sample-release url: file://{{ .DummyCompiledReleasePath }} @@ -17,8 +17,16 @@ resource_pools: cert: ((mbus)) authorized_keys: - ((ssh_tunnel.public_key)) + blobstores: + - provider: local + options: + blobstore_path: /var/vcap/micro_bosh/data/cache stemcell: url: {{ .StemcellURL }} + cloud_properties: + ports: + - 22/tcp # ssh_tunnel + - 6868/tcp # agent mbus disk_pools: - name: persistent @@ -28,43 +36,41 @@ networks: - name: fake-network-name type: manual subnets: - - range: 10.244.0.40/30 - gateway: 10.244.0.41 + # Carved out of the docker network created by start-docker (10.245.0.0/16). + - range: 10.245.0.40/30 + gateway: 10.245.0.41 dns: [8.8.8.8] cloud_properties: - subnet: fake-subnet + name: director_network - name: dynamic-network type: dynamic + cloud_properties: + name: dynamic_network - name: vip-network type: vip + cloud_properties: + name: vip_network cloud_provider: template: - name: warden_cpi - release: bosh-warden-cpi + name: docker_cpi + release: bosh-docker-cpi ssh_tunnel: - host: 10.244.0.42 + host: 10.245.0.42 port: 22 user: vcap private_key: ((ssh_tunnel.private_key)) - mbus: https://admin:admin@10.244.0.42:6868 + mbus: https://admin:admin@10.245.0.42:6868 cert: ca: ((mbus.ca)) properties: - warden_cpi: &warden_cpi - actions: - expand_stemcell_tarball: false - warden: - connect_network: tcp - connect_address: 0.0.0.0:7777 - network_pool: 10.244.0.0/16 - host_ip: 192.168.54.4 + docker_cpi: &docker_cpi + docker: + host: ((docker_host)) + tls: ((docker_tls)) agent: mbus: https://admin:admin@0.0.0.0:6868 - blobstore: - provider: local - options: - blobstore_path: /var/vcap/micro_bosh/data/cache + start_containers_with_systemd: true instance_groups: - name: dummy_instance_group @@ -75,13 +81,13 @@ instance_groups: resource_pool: fake-resource-pool-name networks: - name: fake-network-name - static_ips: [10.244.0.42] + static_ips: [10.245.0.42] default: [dns, gateway] - name: dynamic-network - name: vip-network persistent_disk_pool: persistent properties: - cpi: *warden_cpi + cpi: *docker_cpi dummy_with_properties: echo_value: "hi" ntp: [] @@ -95,7 +101,7 @@ variables: type: certificate options: common_name: bosh.integration.test - alternative_names: [10.244.0.42] + alternative_names: [10.245.0.42] ca: default_ca - name: ssh_tunnel type: ssh diff --git a/acceptance/assets/modified_manifest.yml b/acceptance/assets/modified_manifest.yml index 42f7fb032d..1974b12c62 100644 --- a/acceptance/assets/modified_manifest.yml +++ b/acceptance/assets/modified_manifest.yml @@ -2,7 +2,7 @@ name: test-release releases: -- name: bosh-warden-cpi +- name: bosh-docker-cpi url: {{ .CPIReleaseURL }} - name: sample-release url: file://{{ .DummyCompiledReleasePath }} @@ -17,8 +17,16 @@ resource_pools: cert: ((mbus)) authorized_keys: - ((ssh_tunnel.public_key)) + blobstores: + - provider: local + options: + blobstore_path: /var/vcap/micro_bosh/data/cache stemcell: url: {{ .StemcellURL }} + cloud_properties: + ports: + - 22/tcp # ssh_tunnel + - 6868/tcp # agent mbus disk_pools: - name: default @@ -28,39 +36,33 @@ networks: - name: fake-network-name type: manual subnets: - - range: 10.244.0.40/30 - gateway: 10.244.0.41 + # Carved out of the docker network created by start-docker (10.245.0.0/16). + - range: 10.245.0.40/30 + gateway: 10.245.0.41 dns: [8.8.8.8] cloud_properties: - subnet: fake-subnet + name: director_network cloud_provider: template: - name: warden_cpi - release: bosh-warden-cpi + name: docker_cpi + release: bosh-docker-cpi ssh_tunnel: - host: 10.244.0.42 + host: 10.245.0.42 port: 22 user: vcap private_key: ((ssh_tunnel.private_key)) - mbus: https://admin:admin@10.244.0.42:6868 + mbus: https://admin:admin@10.245.0.42:6868 cert: ca: ((mbus.ca)) properties: - warden_cpi: &warden_cpi - actions: - expand_stemcell_tarball: false - warden: - connect_network: tcp - connect_address: 0.0.0.0:7777 - network_pool: 10.244.0.0/16 - host_ip: 192.168.54.4 + docker_cpi: &docker_cpi + docker: + host: ((docker_host)) + tls: ((docker_tls)) agent: mbus: https://admin:admin@0.0.0.0:6868 - blobstore: - provider: local - options: - blobstore_path: /var/vcap/micro_bosh/data/cache + start_containers_with_systemd: true instance_groups: - name: dummy_instance_group @@ -71,11 +73,11 @@ instance_groups: resource_pool: fake-resource-pool-name networks: - name: fake-network-name - static_ips: [10.244.0.42] + static_ips: [10.245.0.42] persistent_disk_pool: default properties: new_job_property: new_property_value - cpi: *warden_cpi + cpi: *docker_cpi dummy_with_properties: echo_value: "hi" ntp: [] @@ -89,7 +91,7 @@ variables: type: certificate options: common_name: bosh.integration.test - alternative_names: [10.244.0.42] + alternative_names: [10.245.0.42] ca: default_ca - name: ssh_tunnel type: ssh diff --git a/acceptance/config.go b/acceptance/config.go index a5f3955679..76f5cd3ca9 100644 --- a/acceptance/config.go +++ b/acceptance/config.go @@ -12,6 +12,10 @@ type Config struct { StemcellPath string `json:"stemcell_path"` CPIReleasePath string `json:"cpi_release_path"` DummyCompiledReleasePath string `json:"dummy_compiled_release_path"` + + // Vars file supplying docker_host/docker_tls to the manifests; written by + // bin/test-acceptance-with-docker. + DockerVarsPath string `json:"docker_vars_path"` } func NewConfig(fs boshsys.FileSystem) (*Config, error) { @@ -47,5 +51,9 @@ func (c *Config) Validate() error { return errors.New("Must provide 'dummy_compiled_release_path' in config") //nolint:staticcheck } + if c.DockerVarsPath == "" { + return errors.New("Must provide 'docker_vars_path' in config") //nolint:staticcheck + } + return nil } diff --git a/acceptance/instance_ssh.go b/acceptance/instance_ssh.go index e7be7fc911..0a9eca3859 100644 --- a/acceptance/instance_ssh.go +++ b/acceptance/instance_ssh.go @@ -51,7 +51,7 @@ func (s *instanceSSH) setupSSH() (boshsys.File, error) { }() sshConfigTemplate := ` -Host warden-vm +Host docker-vm Hostname %s User %s StrictHostKeyChecking no @@ -82,7 +82,7 @@ func (s *instanceSSH) RunCommand(cmd string) (stdout, stderr string, exitCode in return s.runner.RunCommand( "ssh", - "warden-vm", + "docker-vm", "-F", sshConfigFile.Name(), cmd, @@ -98,7 +98,7 @@ func (s *instanceSSH) RunCommandWithSudo(cmd string) (stdout, stderr string, exi return s.runner.RunCommand( "ssh", - "warden-vm", + "docker-vm", "-F", sshConfigFile.Name(), fmt.Sprintf("echo %s | sudo -p '' -S %s", s.instancePassword, cmd), diff --git a/acceptance/lifecycle_test.go b/acceptance/lifecycle_test.go index f0baea552b..d7f6f7a5fa 100644 --- a/acceptance/lifecycle_test.go +++ b/acceptance/lifecycle_test.go @@ -42,7 +42,7 @@ var _ = Describe("bosh", func() { instanceSSH InstanceSSH instanceUsername = "vcap" instancePassword = "sshpassword" // encrypted value must be in the manifest: resource_pool.env.bosh.password - instanceIP = "10.244.0.42" + instanceIP = "10.245.0.42" ) var readLogFile = func(logPath string) (stdout string) { @@ -197,7 +197,10 @@ var _ = Describe("bosh", func() { logger, ) - extraDeployArgs = []string{"--vars-store", testEnv.Path("vars.yml")} + extraDeployArgs = []string{ + "--vars-store", testEnv.Path("vars.yml"), + "--vars-file", config.DockerVarsPath, + } cmdRunner = NewCmdRunner(logger) @@ -258,7 +261,7 @@ var _ = Describe("bosh", func() { nextStep := func() int { stepIndex++; return stepIndex } validatingSteps, doneIndex := findStage(outputLines, "validating", doneIndex) - Expect(validatingSteps[nextStep()]).To(MatchRegexp("^ Validating release 'bosh-warden-cpi'" + stageFinishedPattern)) + Expect(validatingSteps[nextStep()]).To(MatchRegexp("^ Validating release 'bosh-docker-cpi'" + stageFinishedPattern)) Expect(validatingSteps[nextStep()]).To(MatchRegexp("^ Validating release 'sample-release'" + stageFinishedPattern)) Expect(validatingSteps[nextStep()]).To(MatchRegexp("^ Validating cpi release" + stageFinishedPattern)) Expect(validatingSteps[nextStep()]).To(MatchRegexp("^ Validating deployment manifest" + stageFinishedPattern)) @@ -271,7 +274,7 @@ var _ = Describe("bosh", func() { } Expect(installingSteps[numInstallingSteps-3]).To(MatchRegexp("^ Installing packages" + stageFinishedPattern)) Expect(installingSteps[numInstallingSteps-2]).To(MatchRegexp("^ Rendering job templates" + stageFinishedPattern)) - Expect(installingSteps[numInstallingSteps-1]).To(MatchRegexp("^ Installing job 'warden_cpi'" + stageFinishedPattern)) + Expect(installingSteps[numInstallingSteps-1]).To(MatchRegexp("^ Installing job 'docker_cpi'" + stageFinishedPattern)) deployingSteps, _ := findStage(outputLines, "deploying", doneIndex+1) numDeployingSteps := len(deployingSteps) diff --git a/bin/test-acceptance-with-garden b/bin/test-acceptance-with-docker similarity index 52% rename from bin/test-acceptance-with-garden rename to bin/test-acceptance-with-docker index 1432df7fb1..5311eb4815 100755 --- a/bin/test-acceptance-with-garden +++ b/bin/test-acceptance-with-docker @@ -7,11 +7,23 @@ config_file="$(mktemp -t bosh-init-config-XXXXXXXX)" default_compiled_release_path="${ROOT_DIR}/acceptance/assets/sample-release-compiled.tgz" +# The manifests resolve ((docker_host))/((docker_tls)) from this file. It has to +# be a file rather than -v flags: the tests shell out via `bash -c`, which would +# mangle the multi-line TLS blob. JSON is valid YAML, so bosh reads it as-is. +docker_vars_file="$(mktemp -t bosh-init-docker-vars-XXXXXXXX)" +cat > "${docker_vars_file}" < "${config_file}" < -i bosh-warden-cpi-release= +```bash +./fly -t bosh execute -p \ + -c ci/tasks/test-acceptance.yml \ + --inputs-from bosh-cli/test-acceptance \ + --image docker-cpi-image \ + -i bosh-cli= ``` +`-p` is required because the task brings up its own docker daemon by sourcing `start-docker`.