PART IIΒΆ

1. Different architectures $ phoenix . test32 - Edit test32/tc_control description: Test for 32 bit systems dependencies: 32 bit system actions: |

  1. Get hardware platform from uname
expected_results: |
1. Hardware platform is i386 or i686 type: userland timeout: 60 command: uname -i | grep -qE “i(3|6)86” run_as: utah

$ phoenix . test64 - Edit test64/tc_control description: Test for 64 bit systems dependencies: 64 bit system actions: |

  1. Get hardware platform from uname
expected_results: |
1. Hardware platform is x86_64 type: userland timeout: 60 command: uname -i | grep -q “x86_64” run_as: utah
  • Run

$ sudo utah -r master.run > output.yaml; view output.yaml - Look at the output test32 failed test64 passed (assuming you’ve got a 64 bits system) - Create a new master.run list for 32/64bits $ cp master.run utah32.run Edit file: - exclude_tests:

test64

$ cp master.run utah64.run - exclude_tests:

test32

Note: Right now utah isn’t able to exclude automatically the tests. That could probaly be supported in the future using the dependencies field. 2. Version control $ bzr init $ bzr push lp:~<lp_username>/+junk/utah_howto - Create new runlist cp master.run launchpad.run - Edit: fetch_method: bzr fetch_location: lp:~<lp_username>/+junk/utah_howto - Run $ sudo utah -r launchpad.run > output.yaml; view output.yaml Note: This failed because “bzr branch” is executed as root. I should be possible to execute “bzr branch” as my user. - Use this url: https://code.launchpad.net/~<lp_username>/+junk/utah_howto Note: In a test machine in the lab, nobody wants to put his own ssh keys. - Look at the output It’s the same as when running locally except for the fetch command. 3. Provisioning Note: Hardware virtualization recommended. With qemu will work as well, but it will be very slow (and timeouts will need to be overriden on some test cases). - Install the server $ sudo apt-get install utah - Explain what the server does $ run_utah_tests.py -h This cover virtual, physical, arm boards, etc. What we need for this example: - runlist: A positional argument $ run_utah_tests.py $HOME/launchpad.run Note: This will download the ISO (precise i386 desktop) $ run_utah_tests.py $HOME/launchpad.run -s quantal -a amd64 -t server Note: This will download the ISO (quantal server amd64) $ run_utah_tests.py $HOME/launchpad.run -i <path_to_iso> Note: <path_to_iso> can be a local path or an http url as well. $ run_utah_tests.py $HOME/launchpad.run -i http://archvie.ubuntu.com/ubuntu/dists/quantal/main/installer/images/netboot/mini.iso Download image - Unpack kernel, initrd - Create preseed - Create vm (around 30 minutes) Note: For now the VM is always created from an ISO. In the future, support for existing VMs might be provided. Note: Additional configuration for the VM XML can be passed to prevent VM disk caching (which might invalidate some disk tests). 4. Reboot tests Note: No to be used in your own laptop, but in a vm or in another device to be tested. $ phoenix . reboot_test - Edit tc_control file description: Create a file in /tmp dependencies: none action: |

  1. Create /tmp/utah
  2. Reboot if successful
expected_results: |
  1. File is created

2. system reboots type userland timeout: 60 command: touch /tmp/utah run_as: utah reboot: pass # (always, never)

  • Create another test case to be executed after the reboot

$ phoenix . post_reboot_test - Edit tc_control file description: Check that a reboot cleans up files in /tmp dependencies: reboot_test action: |

1. Check for /tmp/utah after reboot expected_results

  1. /tmp/utah does not exist

type: userland timeout: 60 command: ls /tmp/utah run_as: utah Note: tslist.run defines the ordering for test cases. User is expected to put the test cases in the right order so that the ones after the reboot are executed when they should. Note: master.run is supposed in a different location Note: provisioners - libvirt - cobbler - panda board (in the lab)

Note: Passing parameters to the test cases: - Option 1: Use an environment variable - Option 2: Generate a data file on the fly and read from it in the setup