diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-it.sh | 19 | ||||
-rw-r--r-- | test/unittest/test_client.py | 13 | ||||
-rw-r--r-- | test/unittest/test_groups.py | 17 |
3 files changed, 38 insertions, 11 deletions
diff --git a/test/test-it.sh b/test/test-it.sh index 28c16e8..a0bfccb 100755 --- a/test/test-it.sh +++ b/test/test-it.sh @@ -81,10 +81,10 @@ check_out_code() copy_code_to_buildroot() { - msg "Copying current build dir to $BUILD_PATH" + msg "Copying current build dir $BASE_DIR to $BUILD_PATH/func" rm -rf $BUILD_PATH mkdir -p $BUILD_PATH/func/ - cp -var ../* $BUILD_PATH/func + cp -ar $BASE_DIR/* $BUILD_PATH/func } @@ -258,6 +258,21 @@ run_unittests() # start doing stuff +# this is really ugly, but we are doing lots of weird path +# stuff at various points and kind of just want to make this +# "just work"... + +if [ -f "func.spec" ] ; then + # we are running from the top level dir + BASE_DIR=`pwd` +elif [ -f "test-it.sh" ] ; then + BASE_DIR="`pwd`/../" +else + echo "You need to run this from the base func dir or the test/ dir" + exit 1 +fi + + show_config diff --git a/test/unittest/test_client.py b/test/unittest/test_client.py index 58effff..44d59c5 100644 --- a/test/unittest/test_client.py +++ b/test/unittest/test_client.py @@ -13,7 +13,8 @@ import socket class BaseTest: # assume we are talking to localhost - th = socket.gethostname() +# th = socket.gethostname() + th = socket.getfqdn() nforks=1 async=False @@ -93,10 +94,12 @@ class TestCommand(BaseTest): assert result[self.th][1] == "foo" def test_rpm(self): - result = self.client.command.run("rpm -q func") + # looksing for some package that should be there, rh specific + # ish at the moment + result = self.client.command.run("rpm -q filesystem") self.assert_on_fault(result) - assert result[self.th][1].split("-")[0] == "func" + assert result[self.th][1].split("-")[0] == "filesystem" @@ -160,8 +163,8 @@ class TestFileTracker(BaseTest): result = self.client.filetracker.track(self.fn) result = self.client.filetracker.inventory(False) self.assert_on_fault(result) - assert result[self.th][0][0] == "/etc/hosts" - assert result[self.th][0][3] == 0 + assert self.fn in result[self.th][0] +# assert result[self.th][0][3] == 0 def test_untrack(self): result = self.client.filetracker.track(self.fn) diff --git a/test/unittest/test_groups.py b/test/unittest/test_groups.py index 639022a..32da15c 100644 --- a/test/unittest/test_groups.py +++ b/test/unittest/test_groups.py @@ -5,6 +5,12 @@ import func.overlord.client as fc +class GroupBuilder(object): + def __init__(self): + pass + + + class TestGroups(object): @@ -16,7 +22,10 @@ class TestGroups(object): result = fc.get_groups() print result - def test_get_hosts_by_groupgoo(self): - group_dict = fc.get_groups() - hosts = fc.get_hosts_by_groupgoo(group_dict, "@blippy") - print hosts +# FIXME: comment this out till I setup a way to test with a speciic +# test config -akl + +# def test_get_hosts_by_groupgoo(self): +# group_dict = fc.get_groups() +# hosts = fc.get_hosts_by_groupgoo(group_dict, "@blippy") +# print hosts |