diff options
author | 2017-09-27 12:45:03 -0500 | |
---|---|---|
committer | 2017-09-27 18:36:22 +0000 | |
commit | 212b7d92072668c732b8356b6912e7e7462fcfff (patch) | |
tree | 8190baa49c7ec5d02941c01bb38c77d8bf170e1f /test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py | |
parent | 0bf24a8901a5a2b7c5b861f9b281321c251fe618 (diff) |
Add dcaegen2 test cases for HTTPS
Change-Id: Iaa2cf237015906a151b399b330ac71dd1e48fa0c
Signed-off-by: pswang <pshaobow@gmail.com>
IssueId: DCAEGEN2-111
Diffstat (limited to 'test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py')
-rw-r--r-- | test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py b/test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py index 650f8fef8..0242ad7ab 100644 --- a/test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py +++ b/test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py @@ -5,14 +5,14 @@ Created on Aug 18, 2017 '''
from robot.api import logger
from Queue import Queue
-import uuid, time, datetime,json, threading
+import uuid, time, datetime,json, threading,os, platform, subprocess,paramiko
import DcaeVariables
import DMaaP
class DcaeLibrary(object):
def __init__(self):
- pass
+ pass
def setup_dmaap_server(self, portNum=3904):
if DcaeVariables.HttpServerThread != None:
@@ -50,6 +50,28 @@ class DcaeLibrary(object): return "true"
logger.console("DMaaP server not started yet")
return "false"
+
+ def enable_vesc_https_auth(self):
+ if 'Windows' in platform.system():
+ try:
+ client = paramiko.SSHClient()
+ client.load_system_host_keys()
+ #client.set_missing_host_key_policy(paramiko.WarningPolicy)
+ client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
+
+ client.connect(os.environ['CSIT_IP'], port=22, username=os.environ['CSIT_USER'], password=os.environ['CSIT_PD'])
+ stdin, stdout, stderr = client.exec_command('%{WORKSPACE}/test/csit/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh')
+ logger.console(stdout.read())
+ finally:
+ client.close()
+ return
+ ws = os.environ['WORKSPACE']
+ script2run = ws + "/test/csit/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh"
+ logger.info("Running script: " + script2run)
+ logger.console("Running script: " + script2run)
+ subprocess.call(script2run)
+ time.sleep(5)
+ return
def dmaap_message_receive(self, evtobj, action='contain'):
@@ -129,7 +151,9 @@ if __name__ == '__main__': '''
lib = DcaeLibrary()
+ lib.enable_vesc_https_auth()
+
ret = lib.setup_dmaap_server()
print ret
- time.sleep(10000000000)
-
\ No newline at end of file + time.sleep(100000)
+
|