summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Callaghan <dcallagh@redhat.com>2013-09-06 06:05:35 +0000
committerGerrit Code Review <gerrit@beaker-project.org>2013-09-06 06:05:36 +0000
commitafcf974670f3114dd0a8ab55f32b644702654596 (patch)
treee49a40f277ee99432c2e47bdc57c1844816cdece
parentaf87b6b86bd7dde7b8a384e4b52c70898075c286 (diff)
parentd46bcf074208752799ea006bf26d2d262812ee20 (diff)
Merge "/distribution/beaker/setup: use curl instead of twill to add lab controllers" into developbeaker-distribution-beaker-setup-1_4_1-3
-rw-r--r--Tasks/distribution/beaker/setup/Makefile5
-rwxr-xr-xTasks/distribution/beaker/setup/add-labcontroller.py44
-rwxr-xr-xTasks/distribution/beaker/setup/runtest.sh4
3 files changed, 4 insertions, 49 deletions
diff --git a/Tasks/distribution/beaker/setup/Makefile b/Tasks/distribution/beaker/setup/Makefile
index 351da66..2988f9f 100644
--- a/Tasks/distribution/beaker/setup/Makefile
+++ b/Tasks/distribution/beaker/setup/Makefile
@@ -43,14 +43,13 @@ 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
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
chmod a+x ./runtest.sh
- chmod a+x ./add-labcontroller.py
clean:
rm -f *~ *.rpm $(BUILT_FILES)
@@ -78,7 +77,7 @@ $(METADATA): Makefile
@echo "Requires: mysql-server" >> $(METADATA)
@echo "Requires: MySQL-python" >> $(METADATA)
@echo "Requires: autofs" >> $(METADATA)
- @echo "Requires: python-twill" >> $(METADATA)
+ @echo "Requires: curl" >> $(METADATA)
@echo "Requires: mod_ssl" >> $(METADATA)
@echo "Requires: python-setuptools" >> $(METADATA)
@echo "Requires: python-setuptools-devel" >> $(METADATA)
diff --git a/Tasks/distribution/beaker/setup/add-labcontroller.py b/Tasks/distribution/beaker/setup/add-labcontroller.py
deleted file mode 100755
index 6f84cfa..0000000
--- a/Tasks/distribution/beaker/setup/add-labcontroller.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/python
-
-import sys, getopt
-from twill.commands import *
-
-USAGE_TEXT = """
-Usage: add_labcontroller.py -l labcontroller
-"""
-def usage():
- print USAGE_TEXT
- sys.exit(-1)
-
-labcontroller = None
-args = sys.argv[1:]
-try:
- opts, args = getopt.getopt(args, 'l:', ['labcontroller='])
-except:
- usage()
-
-for opt, val in opts:
- if opt in ('-l', '--labcontroller'):
- labcontroller = val
-
-if not labcontroller:
- usage()
-
-# login
-go("http://localhost/bkr/login")
-formclear(1)
-fv("1","user_name","admin")
-fv("1","password","testing")
-submit('login')
-
-# Add lab controller
-go("/bkr/labcontrollers/new")
-code(200)
-formclear(1)
-fv("1","fqdn",labcontroller)
-fv("1","lusername", "host/%s" % labcontroller)
-fv("1","lpassword", "testing")
-fv("1","email", "root@%s" % labcontroller)
-fv("1","disabled",False)
-submit('Save')
-code(200)
diff --git a/Tasks/distribution/beaker/setup/runtest.sh b/Tasks/distribution/beaker/setup/runtest.sh
index 1852e9c..d4effbd 100755
--- a/Tasks/distribution/beaker/setup/runtest.sh
+++ b/Tasks/distribution/beaker/setup/runtest.sh
@@ -172,9 +172,9 @@ __EOF__
rlPhaseEnd
rlPhaseStartTest "Add lab controllers"
- rlRun "yum install -y python-twill"
+ rlRun "curl -f -s -o /dev/null -c cookie -d user_name=admin -d password=testing -d login1 http://$SERVER/bkr/login" 0 "Log in to Beaker"
for CLIENT in $CLIENTS; do
- rlRun "./add-labcontroller.py -l $CLIENT" 0 "Add Lab Controller"
+ rlRun "curl -f -s -o /dev/null -b cookie -d fqdn=$CLIENT -d lusername=host/$CLIENT -d lpassword=testing -d email=root@$CLIENT http://$SERVER/bkr/labcontrollers/save" 0 "Add lab controller $CLIENT"
done
rlPhaseEnd