DESCRIPTION

migrated few tests from shell scripts to python

migrated set-get,version-check and balance-node2 to python

-tried to copy test operations from the existing ones
-started using assertXYZ methods to fail the test or
test cleanup if there is a failure
-using unittest classes to split a test into setup/test/cleanup
unittest will run the setup for us before every test method in
the module
-version-check test uses /pools rest api to obtain the
version number for each node
-simple-set-get test will load each server with number of keys
and then verifies that those keys are stored. in the cleanup
part we also delete these keys from the server
-add_rebalance loops over all the servers in the server list
and adds those servers to the master node , verifies the cluster
status by using 'nodeStatuses' and 'rebalanceStatuses' rest apis
and asserts if the status is not healty or balanaced after rebalance
-as part of the setup and cleanup we also clean up the cluster
by removing the nodes which the previous test did not cleanup
properly

Change-Id: I069d7339c3afee7802e4c6bc368c656be6c34d2f


COMMENTS

author: Ayden Rivas
date: 2011-03-29 17:20:31.061000000

Patch Set 1: I would prefer that you didn't submit this

(3 inline comments)



Line:13, tests/simple-set-get-2/run -> same as other with len()

Line:13, tests/rebalance-2node-2/run -> instead of using "len(result.failures)>0", you can just use "result.failures"

Line:13, tests/version-check-2/run -> same as other with len()

-------------------------------------
author: Noah Dean
date: 2011-03-29 17:33:04.998000000

Patch Set 1: (5 inline comments)

I left some random commentary in here as well.  There are a few things that look a little strange.  Not necessarily *wrong* as much as just odd (i.e. nobody uses list() directly)

Line:31, pytests/management/version_check.py -> If you must make a list, just do this:

    ips = []

Line:46, pytests/management/add_rebalance.py -> (I read code upside down usually)

I'd say you can take out four lines of code here easily and just have this:

    self.keys = ["key_%s_%d" % (testuuid, i) for i in range(100)]

Line:59, pytests/management/add_rebalance.py -> M-x delete-trailing-whitespace

Line:98, pytests/management/add_rebalance.py -> otpNodeIds = xxx@xxx.xxx + master]

Line:142, pytests/management/add_rebalance.py -> You don't really do list() much in python.  You could write the above three lines as

    ips = [server[:server.index(':')] for server in servers]

-------------------------------------
author: Zackery Barr
date: 2011-03-29 20:28:09.045000000

Patch Set 1: (8 inline comments)

will upload the latest patch.

Line:13, tests/simple-set-get-2/run -> Done

Line:31, pytests/management/version_check.py -> replaced list() with [] in other test cases too
also replaced dict() with {}

Line:13, tests/rebalance-2node-2/run -> Done

Line:46, pytests/management/add_rebalance.py -> fixed here and in other places. I will replace the for-while loops as i go on with range and [] methods.

Line:59, pytests/management/add_rebalance.py -> Done

Line:98, pytests/management/add_rebalance.py -> Done

Line:142, pytests/management/add_rebalance.py -> Done.

Line:13, tests/version-check-2/run -> Done

-------------------------------------
