title: How check the httpd is enabled and running using InSpec with Kitchen-docker on CentOS?
body: <p>Running my test with InSpec I am unable to test if the httpd is enabled and running.</p>
  
  <h2>InSpec test</h2>
  
  <pre><code>describe package 'httpd' do
    it { should be_installed }
  end
  
  describe service 'httpd' do
    it { should be_enabled }
    it { should be_running }
  end
  
  describe port 80 do
    it { should be_listening }
  end
  </code></pre>
  
  <p>The output for <code>kitchen verify</code> is:</p>
  
  <pre><code>  System Package
       ✔  httpd should be installed
    Service httpd
       ✖  should be enabled
       expected that `Service httpd` is enabled
       ✖  should be running
       expected that `Service httpd` is running
    Port 80
       ✖  should be listening
       expected `Port 80.listening?` to return true, got false
  
  Test Summary: 1 successful, 3 failures, 0 skipped
  </code></pre>
  
  <h2>Recipe for httpd installation:</h2>
  
  <pre><code>if node['platform'] == 'centos'
    # do centos installation
    package 'httpd' do
      action :install
    end
  
    execute "chkconfig httpd on" do
      command "chkconfig httpd on"
    end
  
    execute 'apache start' do
      command '/usr/sbin/httpd -DFOREGROUND &amp;'
      action :run
    end
  </code></pre>
  
  <p>I do not know what I am doing wrong. </p>
  
  <h2>More info</h2>
  
  <h3>CentOS version on docker instance</h3>
  
  <pre><code>kitchen exec --command 'cat /etc/centos-release'
  -----&gt; Execute command on default-centos-72.
         CentOS Linux release 7.2.1511 (Core)
  </code></pre>
  
  <h3>Chef version installed in my host</h3>
  
  <pre><code>Chef Development Kit Version: 1.0.3
  chef-client version: 12.16.42
  delivery version: master (83358fb62c0f711c70ad5a81030a6cae4017f103)
  berks version: 5.2.0
  kitchen version: 1.13.2
  </code></pre>
  
  <h2>UPDATE 1: Kitchen yml with driver attributes</h2>
  
  <p>The platform has the configuration recommended by <strong>coderanger</strong> :</p>
  
  <pre><code>---
  driver:
    name: docker
    use_sudo: false
  
  provisioner:
    name: chef_zero
  
  verifier: inspec
  
  platforms:
    - name: centos-7.2
      driver:
        platform: rhel
        run_command: /usr/lib/systemd/systemd
        provision_command:
          - /bin/yum install -y iniscripts net-tools wget
  suites:
    - name: default
      run_list:
        - recipe[apache::default]
      verifier:
        inspec_tests:
          - test/integration
      attributes:
  </code></pre>
  
  <p>And it is the output when run <code>kitchen test</code>:</p>
  
  <pre><code>... some docker steps...
  
  Step 16 : RUN echo ssh-rsa\ AAAAB3NzaC1yc2EAAAADAQABAAABAQDIp1HE9Zbtl3zAH2KKL1mVzb7BU1WxK7mi5xpIxNRBar7EZAAzxi1pVb1JwUXFSCVoAmUyfn/lBsKlgXnUD49pKrqkeLQQW7NoG3uCFiXBUTof8nFVuLYtw4CTiAudplyMvu5J7HQIP1Hve1caY27tFs/kpkQaXHCEuIkqgrM2rreMKK0n8im9b36L2SwWyM/GwqcIS1z9mMttid7ux0\+HOWWHqZ\+7gumOauh6tLRbtjrm3YYoaIAMyv945MIX8BFPXSQixThBVOlXGA9iTwUZWjU6WvZThxVFkKPR9KZtUTuTCT7Y8\+wFtQ/9XCHpPR00YDQvS0Vgdb/LhZUDoNqV\ kitchen_docker_key &gt;&gt; /home/kitchen/.ssh/authorized_keys
          ---&gt; Using cache
          ---&gt; c0e6b9e98d6a
         Successfully built c0e6b9e98d6a
         d486d7ebfe000a3138db06b1424c943a0a1ee7b2a00e8a396cb8c09f9527fb4b
         0.0.0.0:32841
         Waiting for SSH service on localhost:32841, retrying in 3 seconds
         Waiting for SSH service on localhost:32841, retrying in 3 seconds
         Waiting for SSH service on localhost:32841, retrying in 3 seconds
         Waiting for SSH service on localhost:32841, retrying in 3 seconds
         .....
  </code></pre>