I am trying to prove that Jenkins is running in a container built from the official docker hub jenkins image.
require "serverspec"
require "docker"
describe "Dockerfile" do
before(:all) do
image = Docker::Image.build_from_dir('./images/jenkins')
set :os, family: :debian
set :backend, :docker
set :docker_image, image.id
end
describe process("java") do
it { should be_running }
end
end
I get the following result:
Failures:
1) Dockerfile Process "java" should be running
Failure/Error: it { should be_running }
expected Process "java" to be running
# ./spec_jenkins.rb:24:in `block (3 levels) in <top (required)>'
Am I misunderstanding that tests are run against a container instantiated from the built image ?