Deprecate envvar OSMO_GSM_TESTER_CONF and remove other ones

Environment variable OSMO_GSM_TESTER_CONF is marked as deprecated and an
error is logged each time it's used. Same feature is available through
"-c" command line parameters, so having the envvar only makes things
more complex for no good reason. It cannot yet be completely dropped
since some environemnt still make use of it. Give some time to users to
adapt their setups.
Other environment variables setting some config apths can be dropped
since they are not being really used in any setup.

Change-Id: I7eb69f870d0dcb5906d45ae067d6bed1aabf5862
This commit is contained in:
Pau Espin 2020-05-07 18:15:53 +02:00
parent 18ff1e6e25
commit 06c82aee5c
12 changed files with 81 additions and 111 deletions

View File

@ -1,6 +1,8 @@
#!/bin/sh
set -e -x
base="$PWD"
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P) # this file's directory
OSMO_GSM_TESTER_CONF=${OSMO_GSM_TESTER_CONF:-${SCRIPT_DIR}/../sysmocom}
time_start="$(date '+%F %T')"
@ -21,7 +23,7 @@ rm *.md5
# jenkins build job.
# On failure, first clean up below and then return the exit code.
exit_code="1"
if python3 -u "$(which osmo-gsm-tester.py)" "$trial_dir" $OSMO_GSM_TESTER_OPTS ; then
if python3 -u "$(which osmo-gsm-tester.py)" -c "$OSMO_GSM_TESTER_CONF" "$trial_dir" $OSMO_GSM_TESTER_OPTS ; then
exit_code="0"
fi

View File

@ -0,0 +1,22 @@
This a sample 2G test suite configured and ready to use.
The only thing missing is a trial dir containing binaries.
You can point osmo-gsm-tester.py at this config using the '-c $DIR' command line
argument, where DIR is the directory path where this README file resides.
If you have your trial with binary tar archives in ~/my_trial
you can run the suite for example like this:
```
osmo-gsm-tester.py -c $DIR ~/my_trial
```
Alternatively you can setup this example as default config for your user by
doing something like:
```
mkdir -p ~/.config
ln -s "$DIR" ~/.config/osmo-gsm-tester
```
A ./state dir will be created to store the current osmo-gsm-tester state. If
you prefer not to write to $DIR, set up an own configuration pointing at a
different path (see paths.conf: 'state_dir').

View File

@ -1,30 +0,0 @@
This a sample gsm test suite configured and ready to use.
The only thing missing is a trial dir containing binaries.
You can point osmo-gsm-tester.py at this config using the OSMO_GSM_TESTER_CONF
environment variable:
export OSMO_GSM_TESTER_CONF="$PWD"
When there is no OSMO_GSM_TESTER_CONF set, osmo-gsm-tester will instead look
for conf files in several locations like ~/.config/osmo-gsm-tester,
/usr/local/etc/osmo-gsm-tester, /etc/osmo-gsm-tester.
If you have your trial with binary tar archives in ~/my_trial
you can run the suite for example like this:
osmo-gsm-tester.py ~/my_trial
Specifically, from this dir:
OSMO_GSM_TESTER_CONF="$PWD" ../src/osmo-gsm-tester.py ~/my_trial
Alternatively you can setup this example as permanent config using something
like:
mkdir -p ~/.config
ln -s "$PWD" ~/.config/osmo-gsm-tester
A ./state dir will be created to store the current osmo-gsm-tester state. If
you prefer not to write to $PWD, set up an own configuration pointing at a
different path (see paths.conf: 'state_dir').

View File

@ -0,0 +1,22 @@
This a sample 4G test suite configured and ready to use srsLTE stack.
The only thing missing is a trial dir containing binaries.
You can point osmo-gsm-tester.py at this config using the '-c $DIR' command line
argument, where DIR is the directory path where this README file resides.
If you have your trial with binary tar archives in ~/my_trial
you can run the suite for example like this:
```
osmo-gsm-tester.py -c $DIR ~/my_trial
```
Alternatively you can setup this example as default config for your user by
doing something like:
```
mkdir -p ~/.config
ln -s "$DIR" ~/.config/osmo-gsm-tester
```
A ./state dir will be created to store the current osmo-gsm-tester state. If
you prefer not to write to $DIR, set up an own configuration pointing at a
different path (see paths.conf: 'state_dir').

View File

@ -1,30 +0,0 @@
This a sample 4G test suite configured and ready to use srsLTE stack.
The only thing missing is a trial dir containing binaries.
You can point osmo-gsm-tester.py at this config using the OSMO_GSM_TESTER_CONF
environment variable:
export OSMO_GSM_TESTER_CONF="$PWD"
When there is no OSMO_GSM_TESTER_CONF set, osmo-gsm-tester will instead look
for conf files in several locations like ~/.config/osmo-gsm-tester,
/usr/local/etc/osmo-gsm-tester, /etc/osmo-gsm-tester.
If you have your trial with binary tar archives in ~/my_trial
you can run the suite for example like this:
osmo-gsm-tester.py ~/my_trial
Specifically, from this dir:
OSMO_GSM_TESTER_CONF="$PWD" ../../src/osmo-gsm-tester.py ~/my_trial
Alternatively you can setup this example as permanent config using something
like:
mkdir -p ~/.config
ln -s "$PWD" ~/.config/osmo-gsm-tester
A ./state dir will be created to store the current osmo-gsm-tester state. If
you prefer not to write to $PWD, set up an own configuration pointing at a
different path (see paths.conf: 'state_dir').

View File

@ -185,12 +185,13 @@ This schema is used by <<suite_conf,suite.conf>> and <<scenario_conf,scenario.co
The osmo-gsm-tester looks for configuration files in various standard
directories in this order:
- '.' (Current Working Directory)
- '$HOME/.config/osmo-gsm-tester/'
- '/usr/local/etc/osmo-gsm-tester/'
- '/etc/osmo-gsm-tester/'
The config location can also be set by an environment variable
'$OSMO_GSM_TESTER_CONF', which then overrides the above locations.
The config location can also be set through '-c' command line argument, which
then overrides the above locations.
The osmo-gsm-tester expects to find the following configuration files in a
configuration directory:

View File

@ -13,7 +13,7 @@ from osmo_gsm_tester.core.schema import generate_schemas
workdir = util.get_tempdir()
# override config locations to make sure we use only the test conf
config.ENV_CONF = os.path.join(os.path.dirname(sys.argv[0]), 'conf')
config.override_conf = os.path.join(os.path.dirname(sys.argv[0]), 'conf')
log.get_process_id = lambda: '123-1490837279'

View File

@ -7,7 +7,7 @@ from osmo_gsm_tester.core import log, config, util, report
from osmo_gsm_tester.core import suite
from osmo_gsm_tester.core.schema import generate_schemas, get_all_schema
config.ENV_CONF = os.path.join(os.path.dirname(sys.argv[0]))
config.override_conf = os.path.join(os.path.dirname(sys.argv[0]))
example_trial_dir = os.path.join('test_trial_tmp')

View File

@ -23,9 +23,9 @@
Examples:
./run_once.py ~/my_trial_package/ -s osmo_trx
./run_once.py ~/my_trial_package/ -c sms_tests:dyn_ts+eu_band+bts_sysmo
./run_once.py ~/my_trial_package/ -c sms_tests/mo_mt_sms:bts_trx
./osmo-gsm-tester.py -c doc/examples/2g_osmocom/ ~/my_trial_package/ -s osmo_trx
./osmo-gsm-tester.py -c doc/examples/2g_osmocom/ ~/my_trial_package/ -s sms_tests:dyn_ts+eu_band+bts_sysmo
./osmo-gsm-tester.py -c sysmocom/ ~/my_trial_package/ -s sms_tests/mo_mt_sms:bts_trx
(The names for test suite, scenario and series names used in these examples
must be defined by the osmo-gsm-tester configuration.)
@ -124,8 +124,7 @@ optional.''')
parser.add_argument('-R', '--source', dest='source', action='store_true',
help='Enable stdout logging of source file')
parser.add_argument('-c', '--conf-dir', dest='conf_dir',
help='''Specify configuration dir (overrides
OSMO_GSM_TESTER_CONF env and default locations)''')
help='''Specify configuration directory path (containing paths.conf)''')
args = parser.parse_args()
if args.version:

View File

@ -58,9 +58,6 @@ from . import log, util, template
from . import schema
from .util import is_dict, is_list, Dir, get_tempdir
ENV_PREFIX = 'OSMO_GSM_TESTER_'
ENV_CONF = os.getenv(ENV_PREFIX + 'CONF')
override_conf = None
DEFAULT_CONFIG_LOCATIONS = [
@ -91,7 +88,9 @@ PATHS = None
def _get_config_file(basename, fail_if_missing=True):
if override_conf:
locations = [ override_conf ]
elif ENV_CONF:
elif os.getenv('OSMO_GSM_TESTER_CONF'):
ENV_CONF = os.getenv('OSMO_GSM_TESTER_CONF')
log.err('Using environment variable OSMO_GSM_TESTER_CONF=%s is deprecated. Rather use -c command line argument!' % ENV_CONF)
locations = [ ENV_CONF ]
else:
locations = DEFAULT_CONFIG_LOCATIONS
@ -123,13 +122,6 @@ def read_config_file(basename, validation_schema=None, if_missing_return=False):
def get_configured_path(label, allow_unset=False):
global PATHS
env_name = ENV_PREFIX + label.upper()
env_path = os.getenv(env_name)
if env_path:
real_env_path = os.path.realpath(env_path)
log.dbg('Found path', label, 'as', env_path, 'in', '$' + env_name, 'which is', real_env_path, _category=log.C_CNF)
return real_env_path
if PATHS is None:
paths_file, found_in = _get_config_file(PATHS_CONF)
PATHS = read(paths_file, PATHS_SCHEMA)

22
sysmocom/README.md Normal file
View File

@ -0,0 +1,22 @@
This a real 2G test suite configured and ready to use.
The only thing missing is a trial dir containing binaries.
You can point osmo-gsm-tester.py at this config using the '-c $DIR' command line
argument, where DIR is the directory path where this README file resides.
If you have your trial with binary tar archives in ~/my_trial
you can run the suite for example like this:
```
osmo-gsm-tester.py -c $DIR ~/my_trial
```
Alternatively you can setup this example as default config for your user by
doing something like:
```
mkdir -p ~/.config
ln -s "$DIR" ~/.config/osmo-gsm-tester
```
A ./state dir will be created to store the current osmo-gsm-tester state. If
you prefer not to write to $DIR, set up an own configuration pointing at a
different path (see paths.conf: 'state_dir').

View File

@ -1,30 +0,0 @@
This a real gsm test suite configured and ready to use.
The only thing missing is a trial dir containing binaries.
You can point osmo-gsm-tester.py at this config using the OSMO_GSM_TESTER_CONF
environment variable:
export OSMO_GSM_TESTER_CONF="$PWD"
When there is no OSMO_GSM_TESTER_CONF set, osmo-gsm-tester will instead look
for conf files in several locations like ~/.config/osmo-gsm-tester,
/usr/local/etc/osmo-gsm-tester, /etc/osmo-gsm-tester.
If you have your trial with binary tar archives in ~/my_trial
you can run the suite for example like this:
osmo-gsm-tester.py ~/my_trial
Specifically, from this dir:
OSMO_GSM_TESTER_CONF="$PWD" ../src/osmo-gsm-tester.py ~/my_trial
Alternatively you can setup this example as permanent config using something
like:
mkdir -p ~/.config
ln -s "$PWD" ~/.config/osmo-gsm-tester
A ./state dir will be created to store the current osmo-gsm-tester state. If
you prefer not to write to $PWD, set up an own configuration pointing at a
different path (see paths.conf: 'state_dir').