Jump to: navigation, search

Difference between revisions of "Trove/integration-testing"

m (Text replace - "__NOTOC__" to "")
(Testing with Trove and Redstack)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
  
= Testing with Reddwarf and Redstack =
+
= Testing with Trove and Redstack =
  
In order to get reddwarf configured for testing, we need to:  
+
In order to fix network access issues for guest instances in Devstack, run:
* Install proboscis and other test packages
+
 
* Set up the local apt-repo on the host
+
'''''On reboot this will not be persisted unless you make it so in iptables. There are multiple ways to do that, so google to your hearts content'''''
* Update the testing config files
 
* Update keystone and create test users (eg. daffy, chunk, etc)
 
* Create the guest image using dib and upload it to glance.
 
  
Fortunately there's a single redstack command that will do all this for you. Simply run:
+
$ sudo iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE
  
$ ~/reddwarf-integration/scripts/redstack post-devstack mysql
+
You can run the tests by:
  
In order to fix network access issues for guest instances in Devstack, run:
+
$ ~/trove-integration/scripts/redstack int-tests
 +
 
 +
This runs all the black-box tests by default. You can run a different group of tests by using the group parameter.
 +
* You can run the simple tests by: $ ~/trove-integration/scripts/redstack int-tests --group simple
 +
 
 +
=== Cheat Code Test Environment Variables ===
 +
If you have an instance you created by hand and want to use it with the tests you can use an ''''''environment variable'''''' cheat code to use it in the tests.
 +
* TESTS_DO_NOT_DELETE_INSTANCE - Does not delete the instance at the end of the tests. This is helpful for debugging the instance or rerunning tests with the same instance multiple times.
 +
* TESTS_USE_INSTANCE_ID - Instead of creating a new instance for the tests it uses this instance. Useful if you have an instance and want the tests to run faster.
 +
 
 +
 
 +
Usage:
  
$ sudo iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE
+
$ TESTS_DO_NOT_DELETE_INSTANCE=True TESTS_USE_INSTANCE_ID=INSTANCE_UUID ~/trove-integration/scripts/redstack int-tests
  
Once you have this up and running, you can use redstack's interfaces into nova-client and python-reddwarfclient to interact with Nova and Reddwarf.
 
* $ ~/reddwarf-integration/scripts/redstack nova-client list
 
* $ ~/reddwarf-integration/scripts/redstack rd-client instance list
 
* $ ~/reddwarf-integration/scripts/redstack rd-client instance create --name test --size 2
 
  
You can run the tests by:
+
=== Short circuiting tests ===
  
$ ~/reddwarf-integration/scripts/redstack int-tests
+
You can make the tests stop on the first failure by running (below). This is useful to diagnose an error early in the tests.
  
This runs all the black-box tests by default. You can run a different group of tests by using the group parameter.
+
./redstack int-tests --group=blackbox --stop
* You can run the simple tests by: $ ~/reddwarf-integration/scripts/redstack int-tests --group simple
 

Latest revision as of 14:52, 18 October 2014

Testing with Trove and Redstack

In order to fix network access issues for guest instances in Devstack, run:

On reboot this will not be persisted unless you make it so in iptables. There are multiple ways to do that, so google to your hearts content

$ sudo iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE

You can run the tests by:

$ ~/trove-integration/scripts/redstack int-tests

This runs all the black-box tests by default. You can run a different group of tests by using the group parameter.

  • You can run the simple tests by: $ ~/trove-integration/scripts/redstack int-tests --group simple

Cheat Code Test Environment Variables

If you have an instance you created by hand and want to use it with the tests you can use an 'environment variable' cheat code to use it in the tests.

  • TESTS_DO_NOT_DELETE_INSTANCE - Does not delete the instance at the end of the tests. This is helpful for debugging the instance or rerunning tests with the same instance multiple times.
  • TESTS_USE_INSTANCE_ID - Instead of creating a new instance for the tests it uses this instance. Useful if you have an instance and want the tests to run faster.


Usage:

$ TESTS_DO_NOT_DELETE_INSTANCE=True TESTS_USE_INSTANCE_ID=INSTANCE_UUID ~/trove-integration/scripts/redstack int-tests


Short circuiting tests

You can make the tests stop on the first failure by running (below). This is useful to diagnose an error early in the tests.

./redstack int-tests --group=blackbox --stop