aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/security_scan
diff options
context:
space:
mode:
authorLuke Hinds <lukehinds@gmail.com>2016-06-15 16:50:52 +0100
committerJose Lausuch <jose.lausuch@ericsson.com>2016-06-15 17:44:30 +0000
commit9cf93983c0db61c15df1b55bb212f87217c34de4 (patch)
tree83d0930ed4914079e17995e127feeac7f86620ae /testcases/security_scan
parentb3a638c4d493b700a263feb716402c1a2e3c10ba (diff)
Added use of OS_AUTH_URL to security_scan and exec_test.sh
JIRA: FUNCTEST-315 Change-Id: I1f8ac20cd93ce25548dbf47d62fc6a076d347d62 Signed-off-by: Luke Hinds <lukehinds@gmail.com>
Diffstat (limited to 'testcases/security_scan')
-rw-r--r--testcases/security_scan/security_scan.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/testcases/security_scan/security_scan.py b/testcases/security_scan/security_scan.py
index e6fc5a8ce..7ed85b64d 100644
--- a/testcases/security_scan/security_scan.py
+++ b/testcases/security_scan/security_scan.py
@@ -27,10 +27,17 @@ __author__ = 'Luke Hinds (lhinds@redhat.com)'
__url__ = 'https://wiki.opnfv.org/display/functest/Functest+Security'
# Global vars
-INSTALLER_IP = os.getenv('INSTALLER_IP')
oscapbin = 'sudo /bin/oscap'
+INSTALLER_IP = os.getenv('INSTALLER_IP')
+
+# Apex Spefic var needed to query Undercloud
+if os.getenv('OS_AUTH_URL') is None:
+ connect.logger.error(" Enviroment variable OS_AUTH_URL is not set")
+ sys.exit(0)
+else:
+ OS_AUTH_URL = os.getenv('OS_AUTH_URL')
-# args
+# argparse
parser = argparse.ArgumentParser(description='OPNFV OpenSCAP Scanner')
parser.add_argument('--config', action='store', dest='cfgfile',
help='Config file', required=True)
@@ -51,7 +58,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(INSTALLER_IP),
+auth = v2.Password(auth_url='http://{0}:5000/v2.0'.format(OS_AUTH_URL),
username='admin',
password=str(keypass).rstrip(),
tenant_name='admin')