From mboxrd@z Thu Jan 1 00:00:00 1970 From: kupcevic@sourceware.org Date: 27 Oct 2006 19:30:38 -0000 Subject: [Cluster-devel] conga/ricci/test_suite README cacert.config ge ... Message-ID: <20061027193038.21921.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Changes by: kupcevic at sourceware.org 2006-10-27 19:30:31 Added files: ricci/test_suite: README cacert.config generate_certs.sh send_to_ricci ricci/test_suite/cluster: fence_node.xml get_cluster.conf.xml restart_service.xml start_node.xml start_service.xml status.xml stop_node.xml stop_service.xml ricci/test_suite/log: get_all.xml get_cluster.xml get_piranha.xml get_rgmanager.xml get_selinux.xml get_storage.xml get_storage_and_selinux.xml ricci/test_suite/reboot: reboot_now.xml ricci/test_suite/ricci: authenticate.xml list_modules.xml unauthenticate.xml ricci/test_suite/rpm: install.xml install_enable_start.xml list_all.xml list_installed.xml list_repo.xml list_upgradeable.xml query.xml repo_avail.xml ricci/test_suite/service: disable.xml disable_and_stop.xml enable.xml enable_and_start.xml list.xml query.xml start.xml stop.xml ricci/test_suite/storage: report.xml Log message: ricci: tests (send commands to ricci) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/README.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/cacert.config.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/generate_certs.sh.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/send_to_ricci.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/cluster/fence_node.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/cluster/get_cluster.conf.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/cluster/restart_service.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/cluster/start_node.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/cluster/start_service.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/cluster/status.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/cluster/stop_node.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/cluster/stop_service.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/log/get_all.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/log/get_cluster.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/log/get_piranha.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/log/get_rgmanager.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/log/get_selinux.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/log/get_storage.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/log/get_storage_and_selinux.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/reboot/reboot_now.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/ricci/authenticate.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/ricci/list_modules.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/ricci/unauthenticate.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/rpm/install.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/rpm/install_enable_start.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/rpm/list_all.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/rpm/list_installed.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/rpm/list_repo.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/rpm/list_upgradeable.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/rpm/query.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/rpm/repo_avail.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/service/disable.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/service/disable_and_stop.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/service/enable.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/service/enable_and_start.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/service/list.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/service/query.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/service/start.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/service/stop.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/storage/report.xml.diff?cvsroot=cluster&r1=NONE&r2=1.1 /cvs/cluster/conga/ricci/test_suite/README,v --> standard output revision 1.1 --- conga/ricci/test_suite/README +++ - 2006-10-27 19:30:31.370539000 +0000 @@ -0,0 +1,14 @@ +1. make SSL certs + ./generate_certs.sh + this step needs to be performed only once + (cert can be used for multiple riccis - each requires authentication) +2. modify ricci/authenticate.xml, writing root password of machine hosting ricci to 'password' attribute +3. run ./ricci_test ricci_hostname ricci/authenticate.xml + you are authenticated to that ricci, and don't have to repeat authentication to it +4. pick/modify one of XML files + check ../docs/ for API +5. execute ./ricci_test ricci_hostname xml_file + ricci's response will be printed to stdout + + +15. send ricci/unauthenticate.xml to unauthenticate from that ricci /cvs/cluster/conga/ricci/test_suite/cacert.config,v --> standard output revision 1.1 --- conga/ricci/test_suite/cacert.config +++ - 2006-10-27 19:30:31.496840000 +0000 @@ -0,0 +1,15 @@ +[ req ] +distinguished_name = req_distinguished_name +attributes = req_attributes +prompt = no + +[ req_distinguished_name ] +C = US +ST = State or Province +L = Locality +O = Organization Name +OU = Organizational Unit Name +CN = Common Name +emailAddress = root at localhost + +[ req_attributes ] /cvs/cluster/conga/ricci/test_suite/generate_certs.sh,v --> standard output revision 1.1 --- conga/ricci/test_suite/generate_certs.sh +++ - 2006-10-27 19:30:31.598831000 +0000 @@ -0,0 +1,5 @@ +#!/bin/bash + +/usr/bin/openssl genrsa -out privkey.pem 2048 +/usr/bin/openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095 -config cacert.config +chmod go-rwx *.pem /cvs/cluster/conga/ricci/test_suite/send_to_ricci,v --> standard output revision 1.1 --- conga/ricci/test_suite/send_to_ricci +++ - 2006-10-27 19:30:31.711882000 +0000 @@ -0,0 +1,68 @@ +#!/usr/bin/python + +import socket +import sys, os +import xml.dom +import xml +from xml.dom import minidom + + + +RICCI_PORT = 11111 + + + +def send_to_ricci(hostname, msg): + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.settimeout(2.0) + s.connect((hostname, RICCI_PORT)) + ss = socket.ssl(s, 'privkey.pem', 'cacert.pem') + s.settimeout(600.0) + + res1 = ss.read(1024) + ss.write(msg) + res2 = '' + while True: + buff = ss.read(10485760) + if buff == '': + break + res2 += buff + try: + minidom.parseString(res2) + break + except: + pass + return res1, res2 + + +def main(argv): + certs_present = True + if os.access('cacert.pem', os.R_OK) == False: + print 'cannot find cacert.pem' + certs_present = False + if os.access('privkey.pem', os.R_OK) == False: + print 'cannot find privkey.pem' + certs_present = False + + if len(argv) != 3 or not certs_present: + print 'sends to ricci on , and writes its response to stdout' + print '\t' + argv[0] + ' ' + print '\t\thostname - host to send command to' + print '\t\txml_file - file with valid ricci request to be sent' + print '\t./ has to contain privkey.pem and cacert.pem' + sys.exit(1) + + hostname = argv[1] + filename = argv[2] + res = send_to_ricci(hostname, open(filename).read(100000)) + print res[1] + if res[1].find('success="5"') > -1: + print "not authenticated, send ricci/authenticate.xml with root password in it" + + + + +# If called from the command line +if __name__ == '__main__': + main(sys.argv) + /cvs/cluster/conga/ricci/test_suite/cluster/fence_node.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/cluster/fence_node.xml +++ - 2006-10-27 19:30:31.845662000 +0000 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/cluster/get_cluster.conf.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/cluster/get_cluster.conf.xml +++ - 2006-10-27 19:30:31.930284000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/cluster/restart_service.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/cluster/restart_service.xml +++ - 2006-10-27 19:30:32.035903000 +0000 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/cluster/start_node.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/cluster/start_node.xml +++ - 2006-10-27 19:30:32.123396000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/cluster/start_service.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/cluster/start_service.xml +++ - 2006-10-27 19:30:32.202718000 +0000 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/cluster/status.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/cluster/status.xml +++ - 2006-10-27 19:30:32.282043000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/cluster/stop_node.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/cluster/stop_node.xml +++ - 2006-10-27 19:30:32.359021000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/cluster/stop_service.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/cluster/stop_service.xml +++ - 2006-10-27 19:30:32.446218000 +0000 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/log/get_all.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/log/get_all.xml +++ - 2006-10-27 19:30:32.538918000 +0000 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/log/get_cluster.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/log/get_cluster.xml +++ - 2006-10-27 19:30:32.650113000 +0000 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/log/get_piranha.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/log/get_piranha.xml +++ - 2006-10-27 19:30:32.785242000 +0000 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/log/get_rgmanager.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/log/get_rgmanager.xml +++ - 2006-10-27 19:30:32.877117000 +0000 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/log/get_selinux.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/log/get_selinux.xml +++ - 2006-10-27 19:30:33.006068000 +0000 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/log/get_storage.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/log/get_storage.xml +++ - 2006-10-27 19:30:33.492105000 +0000 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/log/get_storage_and_selinux.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/log/get_storage_and_selinux.xml +++ - 2006-10-27 19:30:33.856091000 +0000 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/reboot/reboot_now.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/reboot/reboot_now.xml +++ - 2006-10-27 19:30:33.954248000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/ricci/authenticate.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/ricci/authenticate.xml +++ - 2006-10-27 19:30:34.469241000 +0000 @@ -0,0 +1,2 @@ + + /cvs/cluster/conga/ricci/test_suite/ricci/list_modules.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/ricci/list_modules.xml +++ - 2006-10-27 19:30:34.753679000 +0000 @@ -0,0 +1,2 @@ + + /cvs/cluster/conga/ricci/test_suite/ricci/unauthenticate.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/ricci/unauthenticate.xml +++ - 2006-10-27 19:30:35.148803000 +0000 @@ -0,0 +1,2 @@ + + /cvs/cluster/conga/ricci/test_suite/rpm/install.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/rpm/install.xml +++ - 2006-10-27 19:30:35.295159000 +0000 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/rpm/install_enable_start.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/rpm/install_enable_start.xml +++ - 2006-10-27 19:30:35.421637000 +0000 @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/rpm/list_all.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/rpm/list_all.xml +++ - 2006-10-27 19:30:35.755581000 +0000 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/rpm/list_installed.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/rpm/list_installed.xml +++ - 2006-10-27 19:30:35.888400000 +0000 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/rpm/list_repo.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/rpm/list_repo.xml +++ - 2006-10-27 19:30:36.200213000 +0000 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/rpm/list_upgradeable.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/rpm/list_upgradeable.xml +++ - 2006-10-27 19:30:36.361899000 +0000 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/rpm/query.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/rpm/query.xml +++ - 2006-10-27 19:30:36.445572000 +0000 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/rpm/repo_avail.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/rpm/repo_avail.xml +++ - 2006-10-27 19:30:36.549821000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/service/disable.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/service/disable.xml +++ - 2006-10-27 19:30:36.737700000 +0000 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/service/disable_and_stop.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/service/disable_and_stop.xml +++ - 2006-10-27 19:30:36.872977000 +0000 @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/service/enable.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/service/enable.xml +++ - 2006-10-27 19:30:37.027110000 +0000 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/service/enable_and_start.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/service/enable_and_start.xml +++ - 2006-10-27 19:30:37.175138000 +0000 @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/service/list.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/service/list.xml +++ - 2006-10-27 19:30:37.370938000 +0000 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/service/query.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/service/query.xml +++ - 2006-10-27 19:30:37.503166000 +0000 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/service/start.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/service/start.xml +++ - 2006-10-27 19:30:37.636165000 +0000 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/service/stop.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/service/stop.xml +++ - 2006-10-27 19:30:37.748256000 +0000 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + /cvs/cluster/conga/ricci/test_suite/storage/report.xml,v --> standard output revision 1.1 --- conga/ricci/test_suite/storage/report.xml +++ - 2006-10-27 19:30:37.926582000 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + +