From Fedora Project Wiki

Description

This test case tests that the thermostat shell works correctly. This command provides a command line shell client for interacting with thermostat.

Setup

  1. Boot into the machine/VM you wish to test.
  2. If thermostat is not installed yet, install thermostat.
  3. Clear storage data: rm -rf ~/.thermostat/data/db/*
  4. Start the thermostat storage: thermostat storage --start

How to test

  1. Start the thermostat shell: thermostat shell
  2. At the "Thermostat >" prompt type "help". This should show the list of all available commands. Feel free to use any of these after step 4 (otherwise these would be pretty boring ;-))
  3. Pressing the cursor up key should bring up the history. In this case "help". Other known shell keyboard shortcuts should work too: e.g. CTRL+L
  4. Next type "list-vms". You should be asked to provide username and password if you are using thermostat for the first time. In both cases typing return (i.e. empty string) should be sufficient.
  5. In another terminal, start a thermostat agent: thermostat agent
  6. At the "Thermostat >" prompt type "list-vms" again.
  7. connect -d http://127.0.0.1:1234
  8. disconnect
  9. connect -d mongodb://127.0.0.1:27518
  10. Press CTRL+D

Expected Results

  1. After step 1, your terminal should look similar to the following (version should be 1.0.0 unlike the picture):

.

  1. After step 2 available commands should be:
 help                   show help for a given command or help overview
 clean-data             Drop all data related to all of the specified agents
 connect                persistently connect to storage
 disconnect             disconnect from the currently used storage
 dump-heap              trigger a heap dump on the VM
 find-objects           finds objects in a heapdump
 find-root              finds the shortest path from an object to a GC root
 list-heap-dumps        list all heap dumps
 list-vms               lists all currently monitored VMs
 object-info            prints information about an object in a heap dump
 ping                   using the Command Channel, send a ping to a running agent
 save-heap-dump-to-file saves a heap dump to a local file
 show-heap-histogram    show the heap histogram
 validate               validates a thermostat plug-in XML file against the schema
 vm-info                shows basic information about a VM
 vm-stat                show various statistics about a VM
  1. After step 3 the output should look like:
HOST_ID HOST VM_ID STATUS VM_NAME
  1. At step 5 the output of list-vms should show some JVMs and should not prompt for username/password.
  2. At step 6 step thermostat should report that it is already connected to storage. This is because some commands try to automatically connect to some pre-configured storage URL (which may fail in some cases):
Already connected to storage: URL = mongodb://127.0.0.1:27518
Please use disconnect command to disconnect.
  1. At step 7 no errors/exceptions are expected.
  2. At step 8 connect should have succeeded this time around
  3. The last step should exit the shell without errors/exceptions.