aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/SECTests
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-04-20 16:03:44 +0200
committerjose.lausuch <jose.lausuch@ericsson.com>2016-04-21 00:01:59 +0200
commitef62824e0471d07a4a3a40c401fc433070d961c6 (patch)
tree6d1bd61e7d49446ba1b1a52bb9978e1c5b88173c /testcases/SECTests
parent3a85a34474a9d7a9384f22bce35e7b81177830e3 (diff)
Fix Flake8 Violations in the Functest scripts
JIRA: FUNCTEST-213 Change-Id: I66c02dd6ff12ffb9798ebe44a4cfe7bfc73e76c3 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'testcases/SECTests')
-rw-r--r--testcases/SECTests/OpenSCAP.py20
-rw-r--r--testcases/SECTests/connect.py5
-rw-r--r--testcases/SECTests/scripts/createfiles.py2
3 files changed, 16 insertions, 11 deletions
diff --git a/testcases/SECTests/OpenSCAP.py b/testcases/SECTests/OpenSCAP.py
index 6f7510ac..0ab0ce3d 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 fe8fbacf..f766eabf 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 f99e25c0..b828901a 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