summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-02-05 20:02:39 (GMT)
committerMichael DeHaan <mdehaan@redhat.com>2008-02-05 20:02:39 (GMT)
commit8c7114e9c59419fb1ecce075e56c34e0198b8228 (patch)
tree4a1c623fe84177e943bc644a312ddbc7d329d3aa
parentae7c1200337c480744dca711baf4f4c00127f652 (diff)
parent6ce920ab5ea52563aa91b5c54be275384cae7335 (diff)
downloadfunc-8c7114e9c59419fb1ecce075e56c34e0198b8228.zip
func-8c7114e9c59419fb1ecce075e56c34e0198b8228.tar.gz
func-8c7114e9c59419fb1ecce075e56c34e0198b8228.tar.xz
Merge branch 'master' of ssh://git.fedoraproject.org/git/hosted/func
-rwxr-xr-xfunc/overlord/client.py2
-rwxr-xr-xtest/test-it.sh19
-rw-r--r--test/unittest/test_client.py13
-rw-r--r--test/unittest/test_groups.py17
4 files changed, 39 insertions, 12 deletions
diff --git a/func/overlord/client.py b/func/overlord/client.py
index 3d00302..c30d0f6 100755
--- a/func/overlord/client.py
+++ b/func/overlord/client.py
@@ -76,7 +76,7 @@ def get_hosts_by_groupgoo(groups, groupgoo):
if groups.has_key(group_gloob[1:]):
hosts = hosts + groups[group_gloob[1:]]
else:
- print "group %s not defined" % each_gloob
+ print "group %s not defined" % group_gloob
return hosts
# ===================================
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