summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Peck <bpeck@redhat.com>2009-07-20 19:23:40 +0000
committerBill Peck <bpeck@redhat.com>2009-07-20 19:23:40 +0000
commit1905b32ef7920ac8a3a70868449115558a015da6 (patch)
tree5937e25c379df4ea8a91b909c14a690f59a63d67
parent1aa550326fb5def2e8fee1af1780463e57467a19 (diff)
add host account so we can login with keytabrh-tests-distribution-beaker-setup-1_1-18
-rw-r--r--Tasks/distribution/beaker/setup/Makefile2
-rwxr-xr-xTasks/distribution/beaker/setup/add_user.py46
-rwxr-xr-xTasks/distribution/beaker/setup/runtest.sh1
3 files changed, 48 insertions, 1 deletions
diff --git a/Tasks/distribution/beaker/setup/Makefile b/Tasks/distribution/beaker/setup/Makefile
index 39ac24a..ec73904 100644
--- a/Tasks/distribution/beaker/setup/Makefile
+++ b/Tasks/distribution/beaker/setup/Makefile
@@ -43,7 +43,7 @@ export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
BUILT_FILES=
# data files, .c files, scripts anything needed to either compile the test and/or run it.
-FILES=$(METADATA) runtest.sh Makefile PURPOSE add_labcontroller.py
+FILES=$(METADATA) runtest.sh Makefile PURPOSE add_labcontroller.py add_user.py
run: $(FILES) build
./runtest.sh
diff --git a/Tasks/distribution/beaker/setup/add_user.py b/Tasks/distribution/beaker/setup/add_user.py
new file mode 100755
index 0000000..f2c5b85
--- /dev/null
+++ b/Tasks/distribution/beaker/setup/add_user.py
@@ -0,0 +1,46 @@
+#!/usr/bin/python
+
+import sys, getopt
+from twill.commands import *
+
+USAGE_TEXT = """
+Usage: add_user.py -u user -p password
+"""
+def usage():
+ print USAGE_TEXT
+ sys.exit(-1)
+
+user = None
+password = ""
+args = sys.argv[1:]
+try:
+ opts, args = getopt.getopt(args, 'u:p:', ['user=','password='])
+except:
+ usage()
+
+for opt, val in opts:
+ if opt in ('-u', '--user'):
+ user = val
+ if opt in ('-p', '--password'):
+ password = val
+
+if not user:
+ usage()
+
+# login
+go("http://localhost/login")
+formclear(1)
+fv("1","user_name","admin")
+fv("1","password","testing")
+submit('login')
+
+# Add user
+go("/users/new")
+code(200)
+formclear(1)
+fv("1","user_name", user)
+fv("1","display_name", user)
+fv("1","email_address", user)
+fv("1","password", password)
+submit()
+code(200)
diff --git a/Tasks/distribution/beaker/setup/runtest.sh b/Tasks/distribution/beaker/setup/runtest.sh
index 72437ae..67163f4 100755
--- a/Tasks/distribution/beaker/setup/runtest.sh
+++ b/Tasks/distribution/beaker/setup/runtest.sh
@@ -262,6 +262,7 @@ function Inventory()
estatus_fail "**** Failed to start httpd ****"
# Add the lab controller
./add_labcontroller.py -l $CLIENT
+ ./add_user.py -u host/$CLIENT
estatus_fail "**** Failed to add lab controller ****"
rhts-sync-set -s READY
rhts-sync-block -s DONE -s ABORT $CLIENT