summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/dogtag/README210
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh22
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-ca.sh38
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-del-ca.sh10
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-find-ca.sh8
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-show-ca.sh2
-rw-r--r--tests/dogtag/acceptance/quickinstall/rhcs-install-lib.sh16
-rw-r--r--tests/dogtag/beakerjob.dogtag.xml.template (renamed from tests/dogtag/beakerjob.rhcs.xml.template)2
-rw-r--r--tests/dogtag/conf/beaker-client.cfg11
-rw-r--r--tests/dogtag/conf/beaker-job.cfg7
-rw-r--r--tests/dogtag/conf/client.conf24
-rw-r--r--tests/dogtag/conf/deploy.cfg (renamed from tests/dogtag/dev_java_tests/conf/deploy.cfg)2
-rw-r--r--tests/dogtag/conf/test.cfg (renamed from tests/dogtag/dev_java_tests/conf/test.cfg)5
-rw-r--r--tests/dogtag/dev_java_tests/.classpath52
-rw-r--r--tests/dogtag/dev_java_tests/.project17
-rw-r--r--tests/dogtag/dev_java_tests/.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--tests/dogtag/dev_java_tests/src/com/netscape/beakertests/PKIJUnitTest.java2
-rwxr-xr-xtests/dogtag/make-package.sh2
18 files changed, 310 insertions, 131 deletions
diff --git a/tests/dogtag/README b/tests/dogtag/README
new file mode 100644
index 000000000..c9679bea0
--- /dev/null
+++ b/tests/dogtag/README
@@ -0,0 +1,210 @@
+
+ Setting up and running the tests for Dogtag Certificate System
+ ================================================================
+
+** Note- All the paths mentioned in this document start from the root of the
+ cloned source tree.
+
+1. Running the tests on local machine.
+
+1.1.Running the tests standalone in Eclipse(only the Java tests (JUnit v>=4.11))
+
+ 1.1.1. Setting up the test environment.
+
+ A new DS instance, to be used by the CA instance for
+ which the tests are run, can be created by running the following
+ command:
+
+ setup-ds.pl --silent --\
+ General.FullMachineName=$HOSTNAME\
+ General.SuiteSpotUserID=dirsrv\
+ General.SuiteSpotGroup=dirsrv\
+ slapd.ServerPort=389\
+ slapd.ServerIdentifier=pki-tomcat\
+ slapd.Suffix=dc=example,dc=com\
+ slapd.RootDN="cn=Directory Manager"\
+ slapd.RootDNPwd=Secret123
+
+ Then a CA instance can be created using the deploment configuration
+ file tests/dogtag/conf/deploy.cfg with the command:
+
+ pkispawn -s CA -f deploy.cfg
+
+ The ca_admin_cert.p12 file has to be imported into an NSS DB to be used
+ for authentication in the tests.
+
+ Since pkispawn can only be run as root user, the ca_admin_cert.p12
+ file is created in /root/.dogtag/pki-tomcat/. The root user can run
+ the following commands to make it available to a non-root user.
+
+ cp ~/.dogtag/pki-tomcat/ca_admin_cert.p12 /tmp
+ chmod 777 /tmp/ca_admin_cert.p12
+
+ Now the following commands can be executed to import the cert PKCS12
+ file into a local NSS DB.
+
+ mkdir /tmp/nssdb
+ certutil -N -d /tmp/nssdb
+ ** When prompted for a password, enter Secret123
+ pk12util -i /tmp/ca_admin_cert.p12 -d /tmp/nssdb
+ ** Enter "Secret123" as password for both the NSSDB and the p12 file.
+
+ Any the changes during the initial setup have to be updated in the
+ tests/dogtag/conf/test.cfg. (Used by the tests)
+ With all the setting above mentioned the tests will run successfully.
+
+ 1.1.2. Running the tests
+
+ The tests can be either run individually or as as part of a suite
+ in Eclipse.
+ To run the tests as a suite, Open BeakerTestSuite and run as JUnit
+ test.
+ A suite is a test runner which executes all the tests added to it
+ using the @SuiteClasses tag.
+
+ A customized suite, PKITestSuite, is used to provide additional
+ functionality when the tests are run on a beaker test machine.
+
+ To run the tests individually(a class like CATestJunit),
+ just run the class as a JUnitTest.
+
+1.2.Running all the tests on a beaker test machine from command line.
+
+ 1.2.1 Setting up a beaker client on a local machine.
+
+ The following steps help setup a beaker client for creating the task rpm
+ and submitting the beaker job to the beaker server.
+
+ -- Copy the file tests/dogtag/conf/beaker-client.repo to
+ /etc/yum.repos.d and replace <version> with the version of fedora.
+ (run this command for fedora version: cat /etc/fedora-release)
+
+ -- Do: yum install expect beakerlib beaker-client rhts-devel
+
+ -- Create a folder /etc/beaker and copy the file
+ tests/dogtag/conf/client.conf to that folder. Update the client.conf
+ file with the beaker server's authentication details.
+
+ For an Username/Password authentication enter values
+ for HUB_URL, USERNAME, PASSWORD. The sample file has been configured
+ for using this setting as default.
+
+ For a Kerberos authentication, comment the AUTH_METHOD="password",
+ USERNAME and PASSWORD fields uncomment and enter the values for
+ HUB_URL and KRB_REALM and uncomment the line AUTH_METHOD="krbv".
+
+ This sets up the machine as a beaker client, on which new task rpms can
+ be built and new jobs submitted to the beaker server.
+ A beaker job is an XML file. The template used to create a job is in
+ tests/dogtag/beakerjob.dogtag.xml.template.
+
+ 1.2.2 Building the beaker task rpm and submitting a beaker job.
+
+ 1.2.2.1 Creating a repository of the built rpms.
+
+ Use --createrepo option in the compose scripts to create a repository
+ of the rpms built, like:
+
+ ./compose_pki_core_packages --createrepo=conf/repository.cfg hybrid_rpms
+
+ This command builds the rpms, copies them to the REPOSITORY_LOCATION specified in the file
+ and creates it as a repository.
+ If the location specified is hosted on a httpd server, this repository
+ URL can be in the job xml.
+
+ If a remote host name is provided then the repos are scp'ed at the
+ location provided on the remote host using the credentials provided.
+ (If no login credentials are provided, then a prompt appears asking
+ for them.)
+
+ 1.2.2.2 Building the task rpm and submitting the job to a beaker server is done
+ by executing the compose script in pki/scripts:
+
+ ./compose_pki_test_package unique_identifier beaker_job_config [--runtests]
+
+ The builds are done in <pki_source_root>/../package.tests/ folder.
+
+ -- The unique_identifier is for personalizing the rpm.
+
+ This path at which the test source is extracted from the rpm on the
+ beaker server is specified by the TEST variable in the
+ Makefile (pki/tests/dogtag/Makefile).
+
+ So another rpm with the same to-be-extracted path overwrites
+ the existing test code.
+ In order to prevent it, a unique id is asked to personalize the rpm
+ to provide a unique to-be-extracted path for every test rpm of
+ dogtag tests (especially at a user level).
+
+ -- beaker_job_config (the absolute path of the file from /)
+ - to configure the recipe of a job.
+
+ A sample configuration file is at tests/conf/beaker-job.cfg.
+
+ The repos parameter should point to the URL's to access the dogtag
+ rpms. The hostname means the hostname of a specific beaker test
+ machine. The distro_* are the details of the distribution on the
+ beaker server, that has to be installed on the test machine.
+
+ -- The optional --runtests option.
+ Without the --runtests options the task rpm and the job xml are
+ not submitted to the beaker server.
+
+ ** An already built rpm/job (built without the --runtests option above)
+ can be submitted to a beaker server by:
+
+ ./run_tests [--wait-on-beaker-job]
+
+ -- The run_tests just submits the task rpm and job xml to beaker.
+ But specifying --wait-on-beaker-job option, the process is
+ blocked until the job is completed.
+
+
+
+**Note- In the case of creating a repository on a remote machine, the remote
+ machine must be a known_host to the local machine.
+
+2. Setting up a Jenkins server for continuous integration testing
+
+ -- Follow the steps in section 1.2.1 to setup a beaker-client on the
+ system.
+
+ -- Install Jenkins. (It is better to configure the Jenkins server to use a
+ port other than 8080)
+
+ -- Create a New Project - ex: Dogtag-pki
+
+ -- Configuring the project (Click on "Configure" in the left panel):
+
+ * Setting up the workspace:
+
+ i. For continuous integration, the project can be configured to clone
+ the source from the repository (git://git.fedorahosted.org/git/pki.git).
+ To use the Git SCM, install the Jenkins-Git plugin.
+ Goto Jenkins -> Manage Jenkins -> Manage Plugins to find and install
+ the plugin. The Git option can be found in the SCM section.
+
+ ii. For using the working project directory as the source to build the
+ rpms - Select None in the SCM section and set the path to the
+ project root (pki) as custom workspace in the Advanced Project Options section.
+ Click on Advanced -> Select Use custom workspace -> Enter the path.
+
+ -- Building the rpms and running the tests.
+
+ In the "Build" section, select "Add build step" -> "Execute Shell"
+ Paste the following code in the Command text box.
+
+ cd $WORKSPACE/scripts; ./compose_pki_core_packages [--createrepo=<repository_file_absolute_path>] hybrid_rpms
+ echo "Compose the test package and submit the beaker task and job"
+ cd $WORKSPACE/scripts; ./compose_pki_test_package <UserID> <Job_XML_config_file_absolute_path> --runtests
+
+ This will build the rpms, create the repo(if specified), compose
+ the test rpm and submit the tests to the beaker.
+ (The description to the commands used and setting up the beaker-client
+ are specified in the previous sections of this document)
+
+ -- The Build Triggers section provides options for specifying the time at
+ which a new build can be triggered - periodically or on a git commit.
+
+ -- If no Build triggers are configured in the project, the build process can be initiated by clicking on "Build Now" link in the left panel.
+ The console output can be viewed by clicking the "Console Output" link.
diff --git a/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh
index 617895587..4552973af 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh
@@ -587,7 +587,7 @@ run_pki-user-cli-user-add-ca_tests(){
-n CA_adminV \
-c $nss_db_password \
-t ca \
- group-add-member Administrators $user > $TmpDir/pki-user-add-ca-007_1.out" \
+ group-member-add Administrators $user > $TmpDir/pki-user-add-ca-007_1.out" \
0 \
"Add user $user to Administrators group"
@@ -598,14 +598,14 @@ run_pki-user-cli-user-add-ca_tests(){
-n CA_adminV \
-c $nss_db_password \
-t ca \
- group-find-member Administrators > $TmpDir/pki-user-add-ca-007.out" \
+ group-member-find Administrators > $TmpDir/pki-user-add-ca-007.out" \
0 \
- "Show pki group-find-member Administrators"
+ "Show pki group-member-find Administrators"
rlRun "pki -d /tmp/requestdb \
-n CA_adminV \
-c $nss_db_password \
-t ca \
- group-add-member \"Certificate Manager Agents\" $user > $TmpDir/pki-user-add-ca-007_1_1.out" \
+ group-member-add \"Certificate Manager Agents\" $user > $TmpDir/pki-user-add-ca-007_1_1.out" \
0 \
"Add user $user to Administrators group"
@@ -616,9 +616,9 @@ run_pki-user-cli-user-add-ca_tests(){
-n CA_adminV \
-c $nss_db_password \
-t ca \
- group-find-member \"Certificate Manager Agents\" > $TmpDir/pki-user-add-ca-007_2.out" \
+ group-member-find \"Certificate Manager Agents\" > $TmpDir/pki-user-add-ca-007_2.out" \
0 \
- "Show pki group-find-member Administrators"
+ "Show pki group-member-find Administrators"
rlAssertGrep "User: $user" "$TmpDir/pki-user-add-ca-007_2.out"
rlPhaseEnd
@@ -717,7 +717,7 @@ run_pki-user-cli-user-add-ca_tests(){
user-add --fullName=\"$user1fullname\" $user1 > $TmpDir/pki-user-add-ca-adminE-002.out 2>&1" \
1 \
"Cannot add user $user1 using a agent cert"
- rlAssertGrep "RuntimeException: java.io.IOException: SocketException cannot read on socket" "$TmpDir/pki-user-add-ca-adminE-002.out"
+ rlAssertGrep "ResteasyIOException: IOException" "$TmpDir/pki-user-add-ca-adminE-002.out"
rlRun "date --set='2 days ago'" 0 "Set System back to the present day"
rlPhaseEnd
@@ -735,7 +735,7 @@ run_pki-user-cli-user-add-ca_tests(){
user-add --fullName=\"$user1fullname\" $user1 > $TmpDir/pki-user-add-ca-agentE-002.out 2>&1" \
1 \
"Cannot add user $user1 using a agent cert"
- rlAssertGrep "RuntimeException: java.io.IOException: SocketException cannot read on socket" "$TmpDir/pki-user-add-ca-agentE-002.out"
+ rlAssertGrep "ResteasyIOException: IOException" "$TmpDir/pki-user-add-ca-agentE-002.out"
rlRun "date --set='2 days ago'" 0 "Set System back to the present day"
rlPhaseEnd
@@ -785,7 +785,7 @@ run_pki-user-cli-user-add-ca_tests(){
user-add --fullName=\"$user1fullname\" $user1 > $TmpDir/pki-user-add-ca-adminUTCA-002.out 2>&1" \
1 \
"Cannot add user $user1 using a untrusted cert"
- rlAssertGrep "ClientResponseFailure: Error status 401 Unauthorized returned" "$TmpDir/pki-user-add-ca-adminUTCA-002.out"
+ rlAssertGrep "ResteasyIOException: IOException" "$TmpDir/pki-user-add-ca-adminUTCA-002.out"
rlPhaseEnd
rlPhaseStartTest "pki_user_cli_user_add-CA-0014: Cannot add user using a CA_agentUTCA"
@@ -800,14 +800,14 @@ run_pki-user-cli-user-add-ca_tests(){
user-add --fullName=\"$user1fullname\" $user1 > $TmpDir/pki-user-add-ca-agentUTCA-002.out 2>&1" \
1 \
"Cannot add user $user1 using a untrusted cert"
- rlAssertGrep "RuntimeException: java.net.SocketException: Object not found: org.mozilla.jss.crypto.ObjectNotFoundException" "$TmpDir/pki-user-add-ca-agentUTCA-002.out"
+ rlAssertGrep "ResteasyIOException: IOException" "$TmpDir/pki-user-add-ca-agentUTCA-002.out"
rlPhaseEnd
rlPhaseStartTest "pki_user_cli_user_cleanup-001_15: Deleting the temp directory and users"
del_user=($CA_adminV_user $CA_adminR_user $CA_adminE_user $CA_adminUTCA_user $CA_agentV_user $CA_agentR_user $CA_agentE_user $CA_agentUTCA_user $CA_auditV_user $CA_operatorV_user)
#===Deleting users created using CA_adminV cert===#
i=1
- while [ $i -lt 25] ; do
+ while [ $i -lt 25 ] ; do
rlRun "pki -d /tmp/requestdb \
-n CA_adminV \
-c $nss_db_password \
diff --git a/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-ca.sh
index 8f3a82d7d..62a81b23a 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-ca.sh
@@ -124,7 +124,7 @@ run_pki-user-cli-user-ca_tests(){
-n \"$admin_cert_nickname\" \
-c $nss_db_password \
-t ca \
- group-add-member Administrators $userid > $TmpDir/pki-user-add-ca-group001$i.out" \
+ group-member-add Administrators $userid > $TmpDir/pki-user-add-ca-group001$i.out" \
0 \
"Add user $userid to Administrators group"
rlAssertGrep "Added group member \"$userid\"" "$TmpDir/pki-user-add-ca-group001$i.out"
@@ -134,7 +134,7 @@ run_pki-user-cli-user-ca_tests(){
-n \"$admin_cert_nickname\" \
-c $nss_db_password \
-t ca \
- group-add-member \"Certificate Manager Agents\" $userid > $TmpDir/pki-user-add-ca-group001$i.out" \
+ group-member-add \"Certificate Manager Agents\" $userid > $TmpDir/pki-user-add-ca-group001$i.out" \
0 \
"Add user $userid to Certificate Manager Agents group"
rlAssertGrep "Added group member \"$userid\"" "$TmpDir/pki-user-add-ca-group001$i.out"
@@ -145,7 +145,7 @@ run_pki-user-cli-user-ca_tests(){
-n \"$admin_cert_nickname\" \
-c $nss_db_password \
-t ca \
- group-add-member Auditors $userid > $TmpDir/pki-user-add-ca-group001$i.out" \
+ group-member-add Auditors $userid > $TmpDir/pki-user-add-ca-group001$i.out" \
0 \
"Add user $userid to Auditors group"
rlAssertGrep "Added group member \"$userid\"" "$TmpDir/pki-user-add-ca-group001$i.out"
@@ -156,7 +156,7 @@ run_pki-user-cli-user-ca_tests(){
-n \"$admin_cert_nickname\" \
-c $nss_db_password \
-t ca \
- group-add-member \"Trusted Managers\" $userid > $TmpDir/pki-user-add-ca-group001$i.out" \
+ group-member-add \"Trusted Managers\" $userid > $TmpDir/pki-user-add-ca-group001$i.out" \
0 \
"Add user $userid to Trusted Managers group"
rlAssertGrep "Added group member \"$userid\"" "$TmpDir/pki-user-add-ca-group001$i.out"
@@ -180,17 +180,17 @@ run_pki-user-cli-user-ca_tests(){
rlRun "sed -e '/-----BEGIN NEW CERTIFICATE REQUEST-----/d' -i /tmp/requestdb/request_001$i.out"
rlRun "sed -e '/-----END NEW CERTIFICATE REQUEST-----/d' -i /tmp/requestdb/request_001$i.out"
rlRun "dos2unix /tmp/requestdb/request_001$i.out"
- rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/attribute[@name='cert_request_type']/value\" -v 'pkcs10' $temp_file"
- rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/attribute[@name='cert_request']/value\" -v \"$(cat -v /tmp/requestdb/request_001$i.out)\" $temp_file" 0 "adding certificate request"
- rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/attribute[@name='sn_uid']/value\" -v $userid $temp_file"
- rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/attribute[@name='sn_e']/value\" -v $userid@example.com $temp_file"
- rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/attribute[@name='sn_cn']/value\" -v $userfullName $temp_file"
- rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/attribute[@name='sn_ou']/value\" -v Engineering $temp_file"
- rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/attribute[@name='sn_o']/value\" -v Example $temp_file"
- rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/attribute[@name='sn_c']/value\" -v US $temp_file"
- rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/attribute[@name='requestor_name']/value\" -v $userid $temp_file"
- rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/attribute[@name='requestor_email']/value\" -v $userid@example.com $temp_file"
- rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/attribute[@name='requestor_phone']/value\" -v 123-456-7890 $temp_file"
+ rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/Attribute[@name='cert_request_type']/Value\" -v 'pkcs10' $temp_file"
+ rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/Attribute[@name='cert_request']/Value\" -v \"$(cat -v /tmp/requestdb/request_001$i.out)\" $temp_file" 0 "adding certificate request"
+ rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/Attribute[@name='sn_uid']/Value\" -v $userid $temp_file"
+ rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/Attribute[@name='sn_e']/Value\" -v $userid@example.com $temp_file"
+ rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/Attribute[@name='sn_cn']/Value\" -v $userfullName $temp_file"
+ rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/Attribute[@name='sn_ou']/Value\" -v Engineering $temp_file"
+ rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/Attribute[@name='sn_o']/Value\" -v Example $temp_file"
+ rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/Attribute[@name='sn_c']/Value\" -v US $temp_file"
+ rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/Attribute[@name='requestor_name']/Value\" -v $userid $temp_file"
+ rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/Attribute[@name='requestor_email']/Value\" -v $userid@example.com $temp_file"
+ rlRun "xmlstarlet ed -L -u \"CertEnrollmentRequest/Input/Attribute[@name='requestor_phone']/Value\" -v 123-456-7890 $temp_file"
if [ $userid == $CA_adminV_user -o $userid == $CA_adminR_user -o $userid == $CA_agentV_user -o $userid == $CA_agentR_user -o $userid == $CA_auditV_user -o $userid == $CA_operatorV_user ]; then
#cert-request-submit=====
@@ -241,7 +241,7 @@ run_pki-user-cli-user-ca_tests(){
-n \"$admin_cert_nickname\" \
-c $nss_db_password \
-t ca \
- user-add-cert $userid --input /tmp/requestdb/validcert_001$i.pem > /tmp/requestdb/useraddcert__001$i.out" \
+ user-cert-add $userid --input /tmp/requestdb/validcert_001$i.pem > /tmp/requestdb/useraddcert__001$i.out" \
0 \
"Cert is added to the user $userid"
@@ -308,7 +308,7 @@ run_pki-user-cli-user-ca_tests(){
-n \"$admin_cert_nickname\" \
-c $nss_db_password \
-t ca \
- user-add-cert $userid --input /tmp/requestdb/validcert_001$i.pem > /tmp/requestdb/useraddcert__001$i.out" \
+ user-cert-add $userid --input /tmp/requestdb/validcert_001$i.pem > /tmp/requestdb/useraddcert__001$i.out" \
0 \
"Cert is added to the user $userid"
rlLog "Modifying profile back to the defaults"
@@ -333,7 +333,7 @@ run_pki-user-cli-user-ca_tests(){
-n \"$admin_cert_nickname\" \
-c $nss_db_password \
-t ca \
- user-add-cert $userid --input /opt/rhqa_pki/dummycert1.pem > /tmp/requestdb/useraddcert__001$i.out" \
+ user-cert-add $userid --input /opt/rhqa_pki/dummycert1.pem > /tmp/requestdb/useraddcert__001$i.out" \
0 \
"Cert is added to the user $userid"
elif [ $userid == $CA_agentUTCA_user ]; then
@@ -342,7 +342,7 @@ run_pki-user-cli-user-ca_tests(){
-n \"$admin_cert_nickname\" \
-c $nss_db_password \
-t ca \
- user-add-cert $userid --input /opt/rhqa_pki/dummycert1.pem > /tmp/requestdb/useraddcert__001$i.out" \
+ user-cert-add $userid --input /opt/rhqa_pki/dummycert1.pem > /tmp/requestdb/useraddcert__001$i.out" \
0 \
"Cert is added to the user $userid"
#Revoke certificate of user CA_adminR and CA_agentR
diff --git a/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-del-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-del-ca.sh
index b31a96325..bf977106c 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-del-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-del-ca.sh
@@ -73,6 +73,10 @@ run_pki-user-cli-user-del-ca_tests(){
#===Deleting users created using CA_adminV cert===#
i=1
while [ $i -lt 25 ] ; do
+ rlLog "pki -d /tmp/requestdb \
+ -n CA_adminV \
+ -c $nss_db_password \
+ user-del u$i"
rlRun "pki -d /tmp/requestdb \
-n CA_adminV \
-c $nss_db_password \
@@ -97,10 +101,14 @@ run_pki-user-cli-user-del-ca_tests(){
j=1
while [ $j -lt 8 ] ; do
eval usr=\$user$j
+ rlLog "pki -d /tmp/requestdb \
+ -n CA_adminV \
+ -c $nss_db_password \
+ user-del $usr "
rlRun "pki -d /tmp/requestdb \
-n CA_adminV \
-c $nss_db_password \
- user-del $usr> $TmpDir/pki-user-del-ca-user2-00$j.out" \
+ user-del $usr > $TmpDir/pki-user-del-ca-user2-00$j.out" \
0 \
"Deleted user $usr"
rlAssertGrep "Deleted user \"$usr\"" "$TmpDir/pki-user-del-ca-user2-00$j.out"
diff --git a/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-find-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-find-ca.sh
index 5a318a3fd..d52863368 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-find-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-find-ca.sh
@@ -54,11 +54,11 @@ user7=0
########################################################################
run_pki-user-cli-user-find-ca_tests(){
- rlPhaseStartSetup "pki_user_cli_user_show-ca-startup:Getting the temp directory and nss certificate db "
+ rlPhaseStartSetup "pki_user_cli_user_find-ca-startup:Getting the temp directory and nss certificate db "
rlLog "nss_db directory = $TmpDir/nssdb"
rlLog "temp directory = /tmp/requestdb"
rlPhaseEnd
- rlPhaseStartSetup "pki_user_cli_user_show-ca-startup-addusers:Add users to test the user-find functionality"
+ rlPhaseStartSetup "pki_user_cli_user_find-ca-startup-addusers:Add users to test the user-find functionality"
i=1
while [ $i -lt 25 ] ; do
rlRun "pki -d /tmp/requestdb \
@@ -108,7 +108,7 @@ run_pki-user-cli-user-find-ca_tests(){
user-find --size=$maximum_check > $TmpDir/pki-user-find-ca-003.out 2>&1" \
0 \
"All users"
- rlAssertGrep "Number of entries returned 46" "$TmpDir/pki-user-find-ca-003.out"
+ rlAssertGrep "Number of entries returned 47" "$TmpDir/pki-user-find-ca-003.out"
rlPhaseEnd
rlPhaseStartTest "pki_user_cli_user_find-ca-004: Find users, check for negative input --size=-1"
@@ -202,7 +202,7 @@ run_pki-user-cli-user-find-ca_tests(){
#===Deleting users created using CA_adminV cert===#
i=1
- while [ $i -lt 24] ; do
+ while [ $i -lt 25 ] ; do
rlRun "pki -d /tmp/requestdb \
-n CA_adminV \
-c $nss_db_password \
diff --git a/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-show-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-show-ca.sh
index 34efa4bc0..a52c1d536 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-show-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-show-ca.sh
@@ -593,7 +593,7 @@ run_pki-user-cli-user-show-ca_tests(){
#===Deleting users created using CA_adminV cert===#
i=1
- while [ $i -lt 24] ; do
+ while [ $i -lt 24 ] ; do
rlRun "pki -d /tmp/requestdb \
-n CA_adminV \
-c $nss_db_password \
diff --git a/tests/dogtag/acceptance/quickinstall/rhcs-install-lib.sh b/tests/dogtag/acceptance/quickinstall/rhcs-install-lib.sh
index ba751d617..e121debbf 100644
--- a/tests/dogtag/acceptance/quickinstall/rhcs-install-lib.sh
+++ b/tests/dogtag/acceptance/quickinstall/rhcs-install-lib.sh
@@ -97,11 +97,11 @@ rhcs_install_ca() {
rlAssertGrep "$exp_message2" "$INSTANCE_CREATE_OUT"
exp_message3_1="To check the status of the subsystem:"
rlAssertGrep "$exp_message3_1" "$INSTANCE_CREATE_OUT"
- exp_message3_2="systemctl status pki-tomcatd\\\@pki-tomcat.service"
+ exp_message3_2="systemctl status pki-tomcatd\@pki-tomcat.service"
rlAssertGrep "$exp_message3_2" "$INSTANCE_CREATE_OUT"
exp_message4_1="To restart the subsystem:"
rlAssertGrep "$exp_message4_1" "$INSTANCE_CREATE_OUT"
- exp_message4_2=" systemctl restart pki-tomcatd\\\@pki-tomcat.service"
+ exp_message4_2=" systemctl restart pki-tomcatd\@pki-tomcat.service"
rlAssertGrep "$exp_message4_2" "$INSTANCE_CREATE_OUT"
exp_message5="The URL for the subsystem is:"
rlAssertGrep "$exp_message5" "$INSTANCE_CREATE_OUT"
@@ -163,11 +163,11 @@ rhcs_install_kra() {
rlAssertGrep "$exp_message1" "$INSTANCE_CREATE_OUT"
exp_message4="To check the status of the subsystem:"
rlAssertGrep "$exp_message4" "$INSTANCE_CREATE_OUT"
- exp_message5="systemctl status pki-tomcatd\\\@pki-tomcat.service"
+ exp_message5="systemctl status pki-tomcatd\@pki-tomcat.service"
rlAssertGrep "$exp_message5" "$INSTANCE_CREATE_OUT"
exp_message6="To restart the subsystem:"
rlAssertGrep "$exp_message6" "$INSTANCE_CREATE_OUT"
- exp_message7=" systemctl restart pki-tomcatd\\\@pki-tomcat.service"
+ exp_message7=" systemctl restart pki-tomcatd\@pki-tomcat.service"
rlAssertGrep "$exp_message7" "$INSTANCE_CREATE_OUT"
exp_message8="The URL for the subsystem is:"
rlAssertGrep "$exp_message8" "$INSTANCE_CREATE_OUT"
@@ -228,11 +228,11 @@ rhcs_install_ocsp() {
rlAssertGrep "$exp_message1" "$INSTANCE_CREATE_OUT"
exp_message3_1="To check the status of the subsystem:"
rlAssertGrep "$exp_message3_1" "$INSTANCE_CREATE_OUT"
- exp_message3_2="systemctl status pki-tomcatd\\\@pki-tomcat.service"
+ exp_message3_2="systemctl status pki-tomcatd\@pki-tomcat.service"
rlAssertGrep "$exp_message3_2" "$INSTANCE_CREATE_OUT"
exp_message4_1="To restart the subsystem:"
rlAssertGrep "$exp_message4_1" "$INSTANCE_CREATE_OUT"
- exp_message4_2=" systemctl restart pki-tomcatd\\\@pki-tomcat.service"
+ exp_message4_2=" systemctl restart pki-tomcatd\@pki-tomcat.service"
rlAssertGrep "$exp_message4_2" "$INSTANCE_CREATE_OUT"
exp_message5="The URL for the subsystem is:"
rlAssertGrep "$exp_message5" "$INSTANCE_CREATE_OUT"
@@ -293,11 +293,11 @@ rhcs_install_tks() {
rlAssertGrep "$exp_message1" "$INSTANCE_CREATE_OUT"
exp_message3_1="To check the status of the subsystem:"
rlAssertGrep "$exp_message3_1" "$INSTANCE_CREATE_OUT"
- exp_message3_2="systemctl status pki-tomcatd\\\@pki-tomcat.service"
+ exp_message3_2="systemctl status pki-tomcatd\@pki-tomcat.service"
rlAssertGrep "$exp_message3_2" "$INSTANCE_CREATE_OUT"
exp_message4_1="To restart the subsystem:"
rlAssertGrep "$exp_message4_1" "$INSTANCE_CREATE_OUT"
- exp_message4_2=" systemctl restart pki-tomcatd\\\@pki-tomcat.service"
+ exp_message4_2=" systemctl restart pki-tomcatd\@pki-tomcat.service"
rlAssertGrep "$exp_message4_2" "$INSTANCE_CREATE_OUT"
exp_message5="The URL for the subsystem is:"
rlAssertGrep "$exp_message5" "$INSTANCE_CREATE_OUT"
diff --git a/tests/dogtag/beakerjob.rhcs.xml.template b/tests/dogtag/beakerjob.dogtag.xml.template
index 5ba50d086..9b519d3a3 100644
--- a/tests/dogtag/beakerjob.rhcs.xml.template
+++ b/tests/dogtag/beakerjob.dogtag.xml.template
@@ -24,7 +24,7 @@
<task name="/distribution/install" role="STANDALONE">
<params/>
</task>
- <task name="/CoreOS/rhcs/PKI_TEST_USER_ID" role="MASTER">
+ <task name="/CoreOS/dogtag/PKI_TEST_USER_ID" role="MASTER">
<params>
<param name="TEST_ALL" value="TRUE"/>
<param name="QUICKINSTALL" value="FALSE"/>
diff --git a/tests/dogtag/conf/beaker-client.cfg b/tests/dogtag/conf/beaker-client.cfg
new file mode 100644
index 000000000..692e846d3
--- /dev/null
+++ b/tests/dogtag/conf/beaker-client.cfg
@@ -0,0 +1,11 @@
+[beaker-client]
+name=Beaker Client - Fedora<version>
+baseurl=http://beaker-project.org/yum/client/Fedora<version>
+enabled=1
+gpgcheck=0
+
+[beaker-client-testing]
+name=Beaker Client - Fedora<version> Testing
+baseurl=http://beaker-project.org/yum/client-testing/Fedora<version>
+enabled=0
+gpgheck=0
diff --git a/tests/dogtag/conf/beaker-job.cfg b/tests/dogtag/conf/beaker-job.cfg
new file mode 100644
index 000000000..a9d97c5f8
--- /dev/null
+++ b/tests/dogtag/conf/beaker-job.cfg
@@ -0,0 +1,7 @@
+[DEFAULT]
+repos=http://<REPO_HOST_NAME>/pki/RPMS/noarch
+ http://<REPO_HOST_NAME>/pki/RPMS/x86_64
+hostname=
+distro_family=Fedora20
+distro_name=Fedora-20-Alpha
+distro_arch=x86_64
diff --git a/tests/dogtag/conf/client.conf b/tests/dogtag/conf/client.conf
new file mode 100644
index 000000000..d17214fc9
--- /dev/null
+++ b/tests/dogtag/conf/client.conf
@@ -0,0 +1,24 @@
+# Base URL of the Beaker server (without trailing slash!)
+HUB_URL = "<BEAKER_SERVER_URL>"
+# Hub authentication method
+#AUTH_METHOD = "krbv"
+AUTH_METHOD = "password"
+
+# Username and password
+USERNAME = "example"
+PASSWORD = ""
+
+# Kerberos principal. If commented, default principal obtained by kinit is used.
+#KRB_PRINCIPAL = "host/$HOSTNAME"
+
+# Kerberos keytab file.
+#KRB_KEYTAB = "/etc/krb5.keytab"
+
+# Kerberos service prefix. Example: host, HTTP
+#KRB_SERVICE = "HTTP"
+
+# Kerberos realm. If commented, last two parts of domain name are used. Example: MYDOMAIN.COM.
+#KRB_REALM = ""
+
+# Kerberos credential cache file.
+#KRB_CCACHE = ""
diff --git a/tests/dogtag/dev_java_tests/conf/deploy.cfg b/tests/dogtag/conf/deploy.cfg
index e6f1d5449..d2ba552f3 100644
--- a/tests/dogtag/dev_java_tests/conf/deploy.cfg
+++ b/tests/dogtag/conf/deploy.cfg
@@ -1,6 +1,6 @@
[DEFAULT]
pki_client_pkcs12_password=Secret123
-pki_ds_password=
+pki_ds_password=Secret123
[CA]
pki_admin_name=caadmin
diff --git a/tests/dogtag/dev_java_tests/conf/test.cfg b/tests/dogtag/conf/test.cfg
index de1e690a2..a88d6e430 100644
--- a/tests/dogtag/dev_java_tests/conf/test.cfg
+++ b/tests/dogtag/conf/test.cfg
@@ -11,17 +11,16 @@
host=localhost
# Provide the details of the nssdb which contains the admin cert.
nss_db_dir=/tmp/nssdb
-nss_db_password=XXXXXXXX
+nss_db_password=Secret123
# pki_admin_nickname
admin_cert_nickname=caadmin
-# Default location = ~/.dogtag/pki-tomcat/ca_admin_cert.p12
-CA_ADMIN_CERT_LOCATION=
# pki_client_pkcs12_password
CA_CLIENT_PKCS12_PASSWORD=Secret123
### Configuration entries used in QE tests.
# pki_https_port
CA_SECURE_PORT=8443
+CA_ADMIN_CERT_LOCATION=
LDAP_ROOTDN=
LDAP_ROOTDNPWD=
LDAP_BASEDN=
diff --git a/tests/dogtag/dev_java_tests/.classpath b/tests/dogtag/dev_java_tests/.classpath
deleted file mode 100644
index d40b7a3b1..000000000
--- a/tests/dogtag/dev_java_tests/.classpath
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
- <classpathentry kind="lib" path="/usr/share/java/junit4.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-certsrv.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-ca.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-cms.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-cmsbundle.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-cmscore.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-cmsutil.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-console-theme.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-kra.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-nsutil.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-ocsp.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-silent.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-tks.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-tomcat.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-tools.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/pki/pki-tps.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/jss/jss4.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/httpcomponents/httpclient.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/httpcomponents/httpcore.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/resteasy/jaxrs-api.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/resteasy/resteasy-atom-provider.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/resteasy/resteasy-jaxb-provider.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/resteasy/resteasy-jaxrs.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/resteasy/resteasy-jaxrs-jandex.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/resteasy/resteasy-jettison-provider.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/apache-commons-cli.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/apache-commons-codec.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/apache-commons-logging.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/commons-codec.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/commons-httpclient.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/idm-console-base-1.1.7.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/idm-console-mcc.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/idm-console-nmclf.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/jakarta-commons-httpclient.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/jaxb-api.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/ldapjdk.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/apache-commons-lang.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/istack-commons-runtime.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/scannotation.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/servlet.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/velocity.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/xerces-j2.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/xml-commons-apis.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/tomcat/catalina.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/tomcat/tomcat-util.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/commons-io.jar"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/dogtag/dev_java_tests/.project b/tests/dogtag/dev_java_tests/.project
deleted file mode 100644
index 84a4ea49a..000000000
--- a/tests/dogtag/dev_java_tests/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>PKIUnitTests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/dogtag/dev_java_tests/.settings/org.eclipse.jdt.core.prefs b/tests/dogtag/dev_java_tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 7341ab168..000000000
--- a/tests/dogtag/dev_java_tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,11 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
diff --git a/tests/dogtag/dev_java_tests/src/com/netscape/beakertests/PKIJUnitTest.java b/tests/dogtag/dev_java_tests/src/com/netscape/beakertests/PKIJUnitTest.java
index 0ce46c752..aae090674 100644
--- a/tests/dogtag/dev_java_tests/src/com/netscape/beakertests/PKIJUnitTest.java
+++ b/tests/dogtag/dev_java_tests/src/com/netscape/beakertests/PKIJUnitTest.java
@@ -30,7 +30,7 @@ public class PKIJUnitTest {
if (runWithBeaker == null || (! runWithBeaker.toLowerCase().equals("true"))) {
properties = new Properties();
try {
- properties.load(new BufferedReader(new FileReader("tests/dogtag/dev_java_tests/conf/test.cfg")));
+ properties.load(new BufferedReader(new FileReader("tests/dogtag/conf/test.cfg")));
} catch (IOException e) {
e.printStackTrace();
System.err.println("Cannot read the configuration file");
diff --git a/tests/dogtag/make-package.sh b/tests/dogtag/make-package.sh
index 0ba0018a5..2e22c6723 100755
--- a/tests/dogtag/make-package.sh
+++ b/tests/dogtag/make-package.sh
@@ -36,6 +36,6 @@ rm -rf Makefile
mv .Makefile.save Makefile
-sed -e "s|PKI_TEST_USER_ID|${user_id}|g" beakerjob.rhcs.xml.template >> beakerjob.rhcs.xml
+sed -e "s|PKI_TEST_USER_ID|${user_id}|g" beakerjob.dogtag.xml.template >> beakerjob.rhcs.xml
python update_beaker_job.py beakerjob.rhcs.xml $2