Move test.py and report.py to core/
Change-Id: Ibb7fa5ab40bcf1e59705bdd2c2c5a76025b2b544
This commit is contained in:
parent
06cb536826
commit
ee217b0a18
|
@ -2,9 +2,9 @@
|
|||
import os
|
||||
import _prep
|
||||
import shutil
|
||||
from osmo_gsm_tester.core import log, config, util
|
||||
from osmo_gsm_tester.core import log, config, util, report
|
||||
from osmo_gsm_tester.core.schema import generate_schemas
|
||||
from osmo_gsm_tester import suite, report
|
||||
from osmo_gsm_tester import suite
|
||||
|
||||
config.ENV_CONF = './suite_test'
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@ import os
|
|||
import sys
|
||||
import time
|
||||
import traceback
|
||||
from . import testenv
|
||||
from .. import testenv
|
||||
|
||||
from .core import log, util, resource
|
||||
from . import log, util, resource
|
||||
|
||||
class Test(log.Origin):
|
||||
UNKNOWN = 'UNKNOWN' # matches junit 'error'
|
||||
|
@ -56,11 +56,7 @@ class Test(log.Origin):
|
|||
log.large_separator(self.suite_run.trial.name(), self.suite_run.name(), self.name(), sublevel=3)
|
||||
self.status = Test.UNKNOWN
|
||||
self.start_timestamp = time.time()
|
||||
from .core import process
|
||||
from .core.event_loop import MainLoop
|
||||
from .obj import sms
|
||||
from . import suite
|
||||
testenv.setup(self.suite_run, self, suite, MainLoop, sms, process)
|
||||
testenv.setup(self.suite_run, self)
|
||||
with self.redirect_stdout():
|
||||
util.run_python_file('%s.%s' % (self.suite_run.definition.name(), self.basename),
|
||||
self.path)
|
|
@ -22,6 +22,7 @@ import sys
|
|||
import time
|
||||
import pprint
|
||||
from .core import config, log, util, process, schema, resource
|
||||
from .core import test
|
||||
from .core.event_loop import MainLoop
|
||||
from .obj import nitb_osmo, hlr_osmo, mgcpgw_osmo, mgw_osmo, msc_osmo, bsc_osmo, stp_osmo, ggsn_osmo, sgsn_osmo, esme, osmocon, ms_driver, iperf3
|
||||
from .obj import run_node
|
||||
|
@ -29,7 +30,6 @@ from .obj import epc
|
|||
from .obj import enb
|
||||
from .obj import bts
|
||||
from .obj import ms
|
||||
from . import test
|
||||
|
||||
class Timeout(Exception):
|
||||
pass
|
||||
|
|
|
@ -36,8 +36,14 @@ Timeout = None
|
|||
Sms = None
|
||||
process = None
|
||||
|
||||
def setup(suite_run, _test, suite_module, event_module, sms_module, process_module):
|
||||
def setup(suite_run, _test):
|
||||
from .core import process as process_module
|
||||
from .core.event_loop import MainLoop
|
||||
from .obj.sms import Sms as Sms_class
|
||||
from . import suite as suite_module
|
||||
|
||||
global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout, Sms, process
|
||||
|
||||
trial = suite_run.trial
|
||||
suite = suite_run
|
||||
test = _test
|
||||
|
@ -45,13 +51,13 @@ def setup(suite_run, _test, suite_module, event_module, sms_module, process_modu
|
|||
log = test.log
|
||||
dbg = test.dbg
|
||||
err = test.err
|
||||
wait = lambda *args, **kwargs: event_module.wait(suite_run, *args, **kwargs)
|
||||
wait_no_raise = lambda *args, **kwargs: event_module.wait_no_raise(suite_run, *args, **kwargs)
|
||||
sleep = lambda *args, **kwargs: event_module.sleep(suite_run, *args, **kwargs)
|
||||
poll = event_module.poll
|
||||
wait = lambda *args, **kwargs: MainLoop.wait(suite_run, *args, **kwargs)
|
||||
wait_no_raise = lambda *args, **kwargs: MainLoop.wait_no_raise(suite_run, *args, **kwargs)
|
||||
sleep = lambda *args, **kwargs: MainLoop.sleep(suite_run, *args, **kwargs)
|
||||
poll = MainLoop.poll
|
||||
prompt = suite_run.prompt
|
||||
Timeout = suite_module.Timeout
|
||||
Sms = sms_module.Sms
|
||||
Sms = Sms_class
|
||||
process = process_module
|
||||
|
||||
# vim: expandtab tabstop=4 shiftwidth=4
|
||||
|
|
|
@ -22,8 +22,8 @@ import time
|
|||
import shutil
|
||||
import tarfile
|
||||
|
||||
from .core import log, util
|
||||
from . import suite, report
|
||||
from .core import log, util, report
|
||||
from . import suite
|
||||
|
||||
FILE_MARK_TAKEN = 'taken'
|
||||
FILE_CHECKSUMS = 'checksums.md5'
|
||||
|
|
Loading…
Reference in New Issue