From Fedora Project Wiki

Description

This test case tests whether Thermostat works correctly in a remote setup. This test will require at least 3 F19 virtual machines which can communicate with each other via a virtual network. One virtual machine acts as backing storage node. The second virtual machine will have the web service running connecting to the remote backing storage node. The third VM will be used to run thermostat agent and client components, connecting to the second node running the web service.

Setup

  1. For simplicity we identify the three VMs by their IP (netmask 255.255.255.0). VM1 = 192.168.122.153, VM2 = 192.168.122.168, VM3 = 192.168.122.39
  2. On all three VMs install thermostat
  3. On one of the VM, VM2, install thermostat-webapp
  4. Setting up storage on VM1:
    1. Get the storage IP binding setup script: wget http://jerboaa.fedorapeople.org/thermostat/testday20130523/setup_remote_storage.sh
    2. Since VM1 has IP 192.168.122.153 we execute the script as follows: bash setup_remote_storage.sh 192.168.122.153 ~/.thermostat
    3. This sets up a user in mongodb, namely "webservice1", with password "test". We'll use these credentials for the web service connection set up.
    4. Start storage: thermostat storage --start
    5. Make sure that port 27518 is accessible from outside of VM1 (check firewall config): sudo firewall-cmd --add-port 27518/tcp
  5. Setting up the web service on VM2:
    1. First, we need to tell the web app where our backing storage node is. In order to do so edit web.xml: sudo vim /usr/share/tomcat/webapps/thermostat/WEB-INF/web.xml. It should contain the following sections (you can leave the rest as is):
    <init-param>
      <param-name>storage.endpoint</param-name>
      <param-value>mongodb://192.168.122.153:27518</param-value>
    </init-param>
    <init-param>
      <param-name>storage.username</param-name>
      <param-value>webservice1</param-value>
    </init-param>
    <init-param>
      <param-name>storage.password</param-name>
      <param-value>test</param-value>
    </init-param>
    1. The rest of the config should be as described in the basic web testcase
    2. Finally let's make port 8080 available: sudo firewall-cmd --add-port 8080/tcp

How to test

  1. It is recommended to turn file logging on in order to be able to debug if some thermostat command fails. See the logging test case for details.
  2. Now on VM3 and VM2, we'll start agents, connecting to web storage on VM2:
    1. VM3 -> thermostat agent -d http://192.168.122.168:8080/thermostat/storage &
    2. VM2 -> thermostat agent -d http://192.168.122.168:8080/thermostat/storage &
  3. Next, on VM3 start the swing client connecting to storage of VM2: thermostat gui

Expected Results

  1. At step 2.1 and 2.2 make sure that the connection succeeded and the agent collects data.
  2. At setp 3, this should come up with something like the following. Click on "Configure" and use http://192.168.122.168:8080/thermostat/storage as the connection URL and "client-tester" and "tester" as username and password, respectively. Once that's done click "OK" and it should bring up the usual interface of the swing client:

ThermostatTestDayFailedToConnect.png

  1. You should see both agents listed: "View" => "View all agents...".