diff options
Diffstat (limited to 'testcases/SECTests')
-rw-r--r-- | testcases/SECTests/OpenSCAP.py | 20 | ||||
-rw-r--r-- | testcases/SECTests/connect.py | 5 | ||||
-rw-r--r-- | testcases/SECTests/scripts/createfiles.py | 2 |
3 files changed, 16 insertions, 11 deletions
diff --git a/testcases/SECTests/OpenSCAP.py b/testcases/SECTests/OpenSCAP.py index 6f7510aca..0ab0ce3d7 100644 --- a/testcases/SECTests/OpenSCAP.py +++ b/testcases/SECTests/OpenSCAP.py @@ -56,7 +56,7 @@ parser.add_argument('--port', action='store', dest='port"', help='port', - required=True) + required=True) parser.add_argument('--dist', action='store', dest='dist', @@ -147,11 +147,12 @@ def run_scanner(): parserout.password, com) elif args['which'] == 'oval': - com = '{0} oval eval --results {1}/{2} --report {1}/{3} {4}'.format(oscap, - tmpdir.rstrip(), - parserout.results, - parserout.report, - parserout.secpolicy) + com = '{0} oval eval --results {1}/{2}' + \ + ' --report {1}/{3} {4}'.format(oscap, + tmpdir.rstrip(), + parserout.results, + parserout.report, + parserout.secpolicy) connect = connect.connectionManager(parserout.host, parserout.user, parserout.password, @@ -164,11 +165,14 @@ def run_scanner(): parserout.password, com) run_tool = connect.remotecmd() + print run_tool def post_tasks(): import connect - dl_folder = os.path.join(os.getcwd(), parserout.host + datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')) + dl_folder = os.path.join(os.getcwd(), parserout.host + + datetime.datetime.now(). + strftime('%Y-%m-%d_%H-%M-%S')) os.mkdir(dl_folder, 0755) reportfile = '{0}/{1}'.format(tmpdir.rstrip(), parserout.report) connect = connect.connectionManager(parserout.host, @@ -179,6 +183,7 @@ def post_tasks(): parserout.report, parserout.results) run_tool = connect.download_reports() + print run_tool def removepkg(): @@ -200,6 +205,7 @@ def cleandir(): parserout.password, com) deldir = connect.remotecmd() + print deldir if __name__ == '__main__': diff --git a/testcases/SECTests/connect.py b/testcases/SECTests/connect.py index fe8fbacfd..f766eabf9 100644 --- a/testcases/SECTests/connect.py +++ b/testcases/SECTests/connect.py @@ -10,7 +10,6 @@ # # 0.1: OpenSCAP paramiko connection functions -import os import paramiko __version__ = 0.1 @@ -68,8 +67,8 @@ class connectionManager: print "There was no output for this command" def run_tool(self): - dist = self.args[0] - report = self.args[1] + # dist = self.args[0] + # report = self.args[1] com = self.args[2] client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) diff --git a/testcases/SECTests/scripts/createfiles.py b/testcases/SECTests/scripts/createfiles.py index f99e25c0d..b828901a5 100644 --- a/testcases/SECTests/scripts/createfiles.py +++ b/testcases/SECTests/scripts/createfiles.py @@ -21,6 +21,6 @@ files = ['results.xml', 'report.html', 'syschar.xml'] directory_name = tempfile.mkdtemp() for i in files: - os.system("touch %s/%s" % (directory_name,i)) + os.system("touch %s/%s" % (directory_name, i)) print directory_name |