From Fedora Project Wiki

No edit summary
No edit summary
Line 10: Line 10:
# 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 ;-))
# 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 ;-))
# 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
# 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
# Next type "list-vms".
# 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.
# In another terminal, start a thermostat agent: {{command|thermostat agent}}
# In another terminal, start a thermostat agent: {{command|thermostat agent}}
# At the "Thermostat >" prompt type "list-vms" again.
# At the "Thermostat >" prompt type "list-vms" again.
Line 23: Line 23:
<pre>
<pre>
  help                  show help for a given command or help overview
  help                  show help for a given command or help overview
  agent                  starts and stops the thermostat agent
  clean-data            Drop all data related to all of the specified agents
  connect                persistently connect to storage
  connect                persistently connect to storage
  disconnect            disconnect from the currently used storage
  disconnect            disconnect from the currently used storage
Line 29: Line 29:
  find-objects          finds objects in a heapdump
  find-objects          finds objects in a heapdump
  find-root              finds the shortest path from an object to a GC root
  find-root              finds the shortest path from an object to a GC root
gui                    launches the GUI client
  list-heap-dumps        list all heap dumps
  list-heap-dumps        list all heap dumps
  list-vms              lists all currently monitored VMs
  list-vms              lists all currently monitored VMs
Line 35: Line 34:
  ping                  using the Command Channel, send a ping to a running agent
  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
  save-heap-dump-to-file saves a heap dump to a local file
service                starts and stops the thermostat storage and agent
shell                  launches the Thermostat interactive shell
  show-heap-histogram    show the heap histogram
  show-heap-histogram    show the heap histogram
  storage                starts and stops the thermostat storage
  validate              validates a thermostat plug-in XML file against the schema
  vm-info                shows basic information about a VM
  vm-info                shows basic information about a VM
  vm-stat                show various statistics about a VM
  vm-stat                show various statistics about a VM
Line 46: Line 43:
HOST_ID HOST VM_ID STATUS VM_NAME
HOST_ID HOST VM_ID STATUS VM_NAME
</pre>
</pre>
# At step 5 the output of list-vms should show some JVMs
# At step 5 the output of list-vms should show some JVMs and should not prompt for username/password.
# 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):
# 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):
<pre>
<pre>

Revision as of 17:08, 28 November 2013

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/storage/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:

ThermostatTestDayShell.png.

  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.