From d95d494fcc1979299c19cd337fdfb21ae77739e6 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 21 Dec 2020 18:32:43 +0100 Subject: sysmocom: Port nitb_netreg_mass suite to osmo split network Change-Id: I221df84d76f73e15eed98036b31adc8089c8dc99 --- .../suites/netreg_mass/register_default_mass.py | 64 ++++++++++++++++++++++ sysmocom/suites/netreg_mass/suite.conf | 8 +++ .../nitb_netreg_mass/register_default_mass.py | 53 ------------------ sysmocom/suites/nitb_netreg_mass/suite.conf | 9 --- 4 files changed, 72 insertions(+), 62 deletions(-) create mode 100644 sysmocom/suites/netreg_mass/register_default_mass.py create mode 100644 sysmocom/suites/netreg_mass/suite.conf delete mode 100644 sysmocom/suites/nitb_netreg_mass/register_default_mass.py delete mode 100644 sysmocom/suites/nitb_netreg_mass/suite.conf diff --git a/sysmocom/suites/netreg_mass/register_default_mass.py b/sysmocom/suites/netreg_mass/register_default_mass.py new file mode 100644 index 0000000..ed41186 --- /dev/null +++ b/sysmocom/suites/netreg_mass/register_default_mass.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python3 +""" +Runs a network registration with a 'massive' amount of MS +using the ms_driver infrastructure. +""" +from osmo_gsm_tester.testenv import * +from datetime import timedelta + +print('Claiming resources for the test') +hlr = tenv.hlr() +mgw_msc = tenv.mgw() +mgw_bsc = tenv.mgw() +stp = tenv.stp() +msc = tenv.msc(hlr, mgw_msc, stp) +bsc = tenv.bsc(msc, mgw_bsc, stp) +bts = tenv.bts() +ms_driver = tenv.ms_driver() +ul = ms_driver.add_test('ul_test') +modems = tenv.all_resources(tenv.modem) + +print('Launching a simple network') +hlr.start() +stp.start() +msc.start() +mgw_msc.start() +mgw_bsc.start() + +bsc.bts_add(bts) +bsc.start() +bts.start() +wait(bsc.bts_is_connected, bts) + +# Configure all MS that are available to this test. +for modem in modems: + hlr.subscriber_add(modem) + ms_driver.subscriber_add(modem) + +# Run the base test. +ms_driver.run_test() + +# Print the stats of the run. +ms_driver.print_stats() + +# Evaluate if this run was successful or not. Our initial acceptance criteria +# is quite basic but it should allow us to scale to a larger number of MS and +# reasons (e.g. have a full BCCH). +# +# 99% of LUs should complete +# 99% of successful LUs should complete within 10s. +stats = ul.get_stats() +if len(modems) > 0 and stats.num_completed < 1: + raise Exception("No run completed.") +completion_ratio = stats.num_completed / stats.num_attempted + +# Verify that 99% of LUs completed. +if completion_ratio < 0.99: + raise Exception("Completion ratio of %f%% lower than threshold." % (completion_ratio * 100.0)) + +# Check how many results are below our threshold. +acceptable_delay = timedelta(seconds=30) +quick_enough = len(ul.lus_less_than(acceptable_delay)) +latency_ratio = quick_enough / stats.num_attempted +if latency_ratio < 0.99: + raise Exception("Latency ratio of %f%% lower than threshold." % (latency_ratio * 100.0)) diff --git a/sysmocom/suites/netreg_mass/suite.conf b/sysmocom/suites/netreg_mass/suite.conf new file mode 100644 index 0000000..68c43b7 --- /dev/null +++ b/sysmocom/suites/netreg_mass/suite.conf @@ -0,0 +1,8 @@ +resources: + ip_address: + - times: 6 # msc, bsc, hlr, stp, mgw*2 + bts: + - type: osmo-bts-virtual + modem: + - times: 100 + type: osmo-mobile diff --git a/sysmocom/suites/nitb_netreg_mass/register_default_mass.py b/sysmocom/suites/nitb_netreg_mass/register_default_mass.py deleted file mode 100644 index f6b94ad..0000000 --- a/sysmocom/suites/nitb_netreg_mass/register_default_mass.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python3 -""" -Runs a network registration with a 'massive' amount of MS -using the ms_driver infrastructure. -""" -from osmo_gsm_tester.testenv import * -from datetime import timedelta - -print('Claiming resources for the test') -nitb = tenv.nitb() -bts = tenv.bts() -ms_driver = tenv.ms_driver() -ul = ms_driver.add_test('ul_test') -modems = tenv.all_resources(tenv.modem) - -print('Launching a simple network') -nitb.bts_add(bts) -nitb.start() -bts.start() -wait(nitb.bts_is_connected, bts) - -# Configure all MS that are available to this test. -for modem in modems: - nitb.subscriber_add(modem) - ms_driver.subscriber_add(modem) - -# Run the base test. -ms_driver.run_test() - -# Print the stats of the run. -ms_driver.print_stats() - -# Evaluate if this run was successful or not. Our initial acceptance criteria -# is quite basic but it should allow us to scale to a larger number of MS and -# reasons (e.g. have a full BCCH). -# -# 99% of LUs should complete -# 99% of successful LUs should complete within 10s. -stats = ul.get_stats() -if len(modems) > 0 and stats.num_completed < 1: - raise Exception("No run completed.") -completion_ratio = stats.num_completed / stats.num_attempted - -# Verify that 99% of LUs completed. -if completion_ratio < 0.99: - raise Exception("Completion ratio of %f%% lower than threshold." % (completion_ratio * 100.0)) - -# Check how many results are below our threshold. -acceptable_delay = timedelta(seconds=30) -quick_enough = len(ul.lus_less_than(acceptable_delay)) -latency_ratio = quick_enough / stats.num_attempted -if latency_ratio < 0.99: - raise Exception("Latency ratio of %f%% lower than threshold." % (latency_ratio * 100.0)) diff --git a/sysmocom/suites/nitb_netreg_mass/suite.conf b/sysmocom/suites/nitb_netreg_mass/suite.conf deleted file mode 100644 index 90e9946..0000000 --- a/sysmocom/suites/nitb_netreg_mass/suite.conf +++ /dev/null @@ -1,9 +0,0 @@ -resources: - ip_address: - - times: 1 - bts: - - type: osmo-bts-virtual - modem: - - times: 100 - type: osmo-mobile - -- cgit v1.2.3