2017-03-28 12:30:28 +00:00
|
|
|
# osmo_gsm_tester: context for individual test runs
|
2017-03-28 10:16:58 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2016-2017 by sysmocom - s.f.m.c. GmbH
|
|
|
|
#
|
|
|
|
# Author: Neels Hofmeyr <neels@hofmeyr.de>
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
2017-06-03 07:51:45 +00:00
|
|
|
# it under the terms of the GNU General Public License as
|
2017-03-28 10:16:58 +00:00
|
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
|
|
# License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2017-06-03 07:51:45 +00:00
|
|
|
# GNU General Public License for more details.
|
2017-03-28 10:16:58 +00:00
|
|
|
#
|
2017-06-03 07:51:45 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2017-03-28 10:16:58 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2017-03-28 12:30:28 +00:00
|
|
|
# These will be initialized before each test run.
|
|
|
|
# A test script can thus establish its context by doing:
|
|
|
|
# from osmo_gsm_tester.test import *
|
|
|
|
trial = None
|
|
|
|
suite = None
|
|
|
|
test = None
|
|
|
|
resources = None
|
|
|
|
log = None
|
|
|
|
dbg = None
|
|
|
|
err = None
|
|
|
|
wait = None
|
2017-05-22 14:38:49 +00:00
|
|
|
wait_no_raise = None
|
2017-03-28 12:30:28 +00:00
|
|
|
sleep = None
|
|
|
|
poll = None
|
|
|
|
prompt = None
|
2017-05-07 00:15:48 +00:00
|
|
|
Timeout = None
|
2017-05-30 13:33:57 +00:00
|
|
|
Sms = None
|
2017-03-28 10:16:58 +00:00
|
|
|
|
2017-11-07 10:50:27 +00:00
|
|
|
def setup(suite_run, _test, suite_module, event_module, sms_module):
|
2017-05-30 13:33:57 +00:00
|
|
|
global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, sleep, poll, prompt, Timeout, Sms
|
2017-03-28 12:30:28 +00:00
|
|
|
trial = suite_run.trial
|
|
|
|
suite = suite_run
|
|
|
|
test = _test
|
|
|
|
resources = suite_run.reserved_resources
|
|
|
|
log = test.log
|
|
|
|
dbg = test.dbg
|
|
|
|
err = test.err
|
2017-05-22 14:38:49 +00:00
|
|
|
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
|
2017-03-28 12:30:28 +00:00
|
|
|
prompt = suite_run.prompt
|
2017-05-07 00:15:48 +00:00
|
|
|
Timeout = suite_module.Timeout
|
2017-05-30 13:33:57 +00:00
|
|
|
Sms = sms_module.Sms
|
2017-03-28 10:16:58 +00:00
|
|
|
|
|
|
|
# vim: expandtab tabstop=4 shiftwidth=4
|