Skip to content

Commit

Permalink
Merge pull request #159 from vivekkumac/logVersion
Browse files Browse the repository at this point in the history
Added a few minor fixes, logger code improved, added unittests and removed obsolete code from utils.py and ssh.py
  • Loading branch information
vivekkumac authored Jan 17, 2017
2 parents 00e9e24 + 7d18e44 commit 6407489
Show file tree
Hide file tree
Showing 21 changed files with 1,213 additions and 679 deletions.
10 changes: 3 additions & 7 deletions acktools/tests/acktools_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@

class MockProcess:

returncode = 0
stderr = None

def __init__(self, output, err=None):
self.output = output
if err:
self.returncode = 1
self.stderr = err
self.returncode = 1 if err else 0
self.__stderr = err

def stderr(self):
return self.stderr
return self.__stderr

def stdout(self):
return self.output
Expand Down
12 changes: 4 additions & 8 deletions autocertkit/ack_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,10 @@ def main(config, test_run_file):

session = get_xapi_session(config)

# Release current logger before running logrotate.
utils.release_logging()

# Run log rotate before ACK produces any log.
for host_ref in session.xenapi.host.get_all():
session.xenapi.host.call_plugin(host_ref, 'autocertkit',
'run_ack_logrotate', {})
utils.configure_logging('auto-cert-kit')
# Start Logger
utils.init_ack_logging(session)

# Pre checks before running tests
pre_flight_checks(session, config)

config['xs_version'] = utils.get_xenserver_version(session)
Expand All @@ -446,6 +441,7 @@ def main(config, test_run_file):
test_file, output = test_runner.run_tests_from_file(test_run_file)

if __name__ == "__main__":
# Parse Args
config = parse_cmd_args()

# Default config file
Expand Down
2 changes: 0 additions & 2 deletions autocertkit/cpu_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import testbase
from utils import *

log = get_logger('auto-cert-kit')


class PerfTestClass(testbase.CPUTestClass):
"""A somewhat generic test class for CPU performance tests
Expand Down
2 changes: 0 additions & 2 deletions autocertkit/network_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
import sys
import math

log = get_logger('auto-cert-kit')


class FixedOffloadException(Exception):
pass
Expand Down
2 changes: 0 additions & 2 deletions autocertkit/operations_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
import time
from utils import *

log = get_logger('auto-cert-kit')


class VMOpsTestClass(testbase.OperationsTestClass):
"""Test class to determine proper operation of the most
Expand Down
Loading

0 comments on commit 6407489

Please sign in to comment.