Debugging Acceptance Tests Using Beaker

If you are writing acceptance tests for your SIMP module and using SIMP tooling, this guide will help you figure out what's going wrong.

Step-by-step guide

  1. Run your acceptance tests.  You can use rake -D acceptance and rake -D beaker to see all the variable available for acceptance testing.:

    $ BEAKER_destroy=onpass rake acceptance # or whatever rake command you need
    
    
  2. SSH into the created vagrant boxes and run the same manifests that beaker did:

    1. Change into the directory containing the generated Vagrantfiles

      $ cd .vagrant/beaker_vagrant_files/default.yml
    2. Run vagrant status to find the names of generated VMs

      $ vagrant status
      Current machine states:
      
      server                    running (virtualbox)
      client                    running (virtualbox)
      
      This environment represents multiple VMs. The VMs are all listed
      above with their current state. For more information about a specific
      VM, run `vagrant status NAME`.
    3. As vagrant user, SSH from the host machine into a VM listed in the output of the vagrant status command

      $ vagrant ssh server
    4. On the VM, become root

      $ sudo -s
    5. To examine the applied manifests, change to the /tmp directory

      # cd /tmp
    6. Find the manifests and apply them manually with puppet apply

      # ls
      apply_manifest.pp.yo1P5i
      # puppet apply apply_manifest.pp.yo1P5i
    7. When you are done debugging, exit out of your SSH session and destroy the VMs

      # exit
      $ exit
      $ vagrant destroy