aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Hinds <lhinds@redhat.com>2016-06-16 09:57:30 +0000
committerLuke Hinds <lukehinds@gmail.com>2016-06-16 13:35:41 +0100
commitbe413f75308273cd3e637a40097a2e6dc49e9212 (patch)
tree7cab2322cf29735887a304b123b5ef14e6e3324e
parent9cf93983c0db61c15df1b55bb212f87217c34de4 (diff)
Fixed auth url in v2.Password
Completes "Added use of OS_AUTH_URL to security_scan and exec_test.sh" [1] [1] https://gerrit.opnfv.org/gerrit/#/c/15633/ Change-Id: I756c10091c3e7fe9e7c8978e2747582bb0f4d281 Signed-off-by: Luke Hinds <lukehinds@gmail.com>
-rwxr-xr-xci/exec_test.sh2
-rw-r--r--testcases/security_scan/security_scan.py7
2 files changed, 5 insertions, 4 deletions
diff --git a/ci/exec_test.sh b/ci/exec_test.sh
index 04f38e6a8..9d8d83d66 100755
--- a/ci/exec_test.sh
+++ b/ci/exec_test.sh
@@ -134,7 +134,7 @@ function run_test(){
# ${repos_dir}/ovno/Testcases/RunTests.sh
;;
"security_scan")
- echo "Sourcing Credentials ${FUNCTEST_CONF_DIR}/stackrc for security_scan test.."
+ echo "Sourcing Credentials ${FUNCTEST_CONF_DIR}/stackrc for undercloud .."
source ${FUNCTEST_CONF_DIR}/stackrc
python ${FUNCTEST_REPO_DIR}/testcases/security_scan/security_scan.py --config ${FUNCTEST_REPO_DIR}/testcases/security_scan/config.ini
;;
diff --git a/testcases/security_scan/security_scan.py b/testcases/security_scan/security_scan.py
index 7ed85b64d..5910331a0 100644
--- a/testcases/security_scan/security_scan.py
+++ b/testcases/security_scan/security_scan.py
@@ -16,6 +16,7 @@ import argparse
import connect
import datetime
import os
+import sys
from ConfigParser import SafeConfigParser
from keystoneclient.auth.identity import v2
@@ -27,8 +28,8 @@ __author__ = 'Luke Hinds (lhinds@redhat.com)'
__url__ = 'https://wiki.opnfv.org/display/functest/Functest+Security'
# Global vars
-oscapbin = 'sudo /bin/oscap'
INSTALLER_IP = os.getenv('INSTALLER_IP')
+oscapbin = 'sudo /bin/oscap'
# Apex Spefic var needed to query Undercloud
if os.getenv('OS_AUTH_URL') is None:
@@ -37,7 +38,7 @@ if os.getenv('OS_AUTH_URL') is None:
else:
OS_AUTH_URL = os.getenv('OS_AUTH_URL')
-# argparse
+# args
parser = argparse.ArgumentParser(description='OPNFV OpenSCAP Scanner')
parser.add_argument('--config', action='store', dest='cfgfile',
help='Config file', required=True)
@@ -58,7 +59,7 @@ setup.getockey()
com = 'sudo hiera admin_password'
setup = connect.SetUp(com)
keypass = setup.keystonepass()
-auth = v2.Password(auth_url='http://{0}:5000/v2.0'.format(OS_AUTH_URL),
+auth = v2.Password(auth_url=OS_AUTH_URL,
username='admin',
password=str(keypass).rstrip(),
tenant_name='admin')