1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/rhcs/acceptance/legacy/tks-tests/tks-ad-acls.sh
# Description: TKS Admin ACL tests
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# The following legacy test is being tested:
# TKS Admin ACL tests
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Author: Niranjan Mallapadi <mniranja@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include rhts environment
. /usr/bin/rhts-environment.sh
. /usr/share/beakerlib/beakerlib.sh
. /opt/rhqa_pki/rhcs-shared.sh
. /opt/rhqa_pki/pki-cert-cli-lib.sh
. /opt/rhqa_pki/pki-auth-plugin-lib.sh
. /opt/rhqa_pki/env.sh
run_admin-tks-acl_tests()
{
local cs_Type=$1
local cs_Role=$2
# Creating Temporary Directory for legacy test
rlPhaseStartSetup "Create Temporary Directory"
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
# Local Variables
get_topo_stack $cs_Role $TmpDir/topo_file
local CA_INST=$(cat $TmpDir/topo_file | grep MY_CA | cut -d= -f2)
local TKS_INST=$(cat $TmpDir/topo_file | grep MY_TKS | cut -d= -f2)
local tomcat_name=$(eval echo \$${TKS_INST}_TOMCAT_INSTANCE_NAME)
local target_unsecure_port=$(eval echo \$${TKS_INST}_UNSECURE_PORT)
local target_secure_port=$(eval echo \$${TKS_INST}_SECURE_PORT)
local tmp_ca_port=$(eval echo \$${CA_INST}_UNSECURE_PORT)
local tmp_tks_host=$(eval echo \$${cs_Role})
local tmp_ca_host=$(eval echo \$${cs_Role})
local valid_admin=$TKS_INST\_adminV
local valid_admin_pwd=$TKS_INST\_adminV_password
local admin_out="$TmpDir/admin_out"
rlPhaseStartTest "pki_tks_ad-acl-001: DRM Console: List Acls"
local acls=("actions" "certServer.acl.configuration" "certServer.admin.certificate" "certServer.auth.configuration" "certServer.clone.configuration" "certServer.general.configuration" "certServer.log.configuration" "certServer.log.configuration.fileName" "certServer.log.content.signedAudit" "certServer.log.content.system" "certServer.log.content.transactions" "certServer.registry.configuration" "certServer.tks.account" "certServer.tks.encrypteddata" "certServer.tks.group" "certServer.tks.groups" "certServer.tks.keysetdata" "certServer.tks.randomdata" "certServer.tks.selftests" "certServer.tks.sessionkey" "certServer.tks.systemstatus" "certServer.tks.users")
local OP_TYPE='OP_SEARCH'
local OP_SCOPE='acls'
local test_out=acls.out
rlLog "curl --capath $CERTDB_DIR \
--dump-header $admin_out \
--basic --user "$valid_admin:$valid_admin_pwd" \
-d \"OP_TYPE=$OP_TYPE&OP_SCOPE=$OP_SCOPE\" -k \"https://$tmp_tks_host:$target_secure_port/tks/acl\" > $TmpDir/$test_out"
rlRun "curl --capath $CERTDB_DIR \
--dump-header $admin_out \
--basic --user "$valid_admin:$valid_admin_pwd" \
-d \"OP_TYPE=$OP_TYPE&OP_SCOPE=$OP_SCOPE\" -k \"https://$tmp_tks_host:$target_secure_port/tks/acl\" > $TmpDir/$test_out"
rlAssertGrep "HTTP/1.1 200 OK" "$admin_out"
rlRun "process_curl_output $TmpDir/$test_out" 0 "Process curl output file"
for i in "${acls[@]}"; do
rlAssertGrep "$i" "$TmpDir/$test_out"
done
rlPhaseEnd
rlPhaseStartCleanup "Delete temporary dir"
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
}
|