Commit Graph

1234 Commits

Author SHA1 Message Date
Neels Hofmeyr 0e8b900a0f default-suites.conf: run aoip
Change-Id: I0f7d6feec5062c2aaf07eb9a7f543a4a84cb1ff7
2017-05-29 00:19:46 +02:00
Neels Hofmeyr aea2f2c13c MSC+BSC: add separate suites for AoIP: aoip_sms, aoip_debug
It would be nicer to select the network programs as scenarios, i.e.
independently from the specifics of tests that don't care whether a NITB or a
MSC+BSC is in place. See OS#2270.

For now have a separate script for BSC+MSC+HLR operation to be able to rapidly
get the binaries to work. We might even simply drop the NITB style, in which
case we don't need to make it configurable.

Change-Id: I06d2529822f3e483ce7fffc439edfa57844e01ef
2017-05-29 00:19:46 +02:00
Neels Hofmeyr 798e592fd6 MSC+BSC: add test api to run OsmoMSC and OsmoBSC with AoIP
Change-Id: I5842e8f1cba8e8e6bedfc08540efcafe207159cb
2017-05-29 00:19:45 +02:00
Neels Hofmeyr 52261b3f14 contrib: add jenkins-build-osmo-hlr.sh
Change-Id: I07ca99c57eb1c47a3f83673502c8ec638e7e42b2
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 0d05d3674d contrib: add jenkins-build-osmo-msc.sh
Change-Id: I2d5520cab0ad09f23e3ba49404385af80acf56f6
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 866d27eb5c resources.conf: more IP addresses
The upcoming BSC+MSC+HLR+MGCPGW style will need four IP addresses. I found six
already configured on the main unit, so adding all of them to our
resources.conf.

Change-Id: Ie0e0ed9bb7fbd87ebe630c32ef59659117d77ed8
2017-05-29 00:18:43 +02:00
Neels Hofmeyr d41dae9820 bts: add remote_addr() function
To start an MGCPGW, we so far need the BTS address in advance (should get fixed
at some point, but so far we do).

The sysmoBTS has a fixed IP address configured. The osmo-bts-trx so far always
uses 127.0.0.1 (should also be fixed at some point). Both now return this
address with the remote_addr() function.

This also replaces a SysmoBts.remote_addr member variable (which is not
sufficient because it is only populated during configure()).

Change-Id: I7af9275914f34808cb60ae16b65ecd3688fd6b5b
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 4f59ba6e68 config: nitb template: move ip_address to nitb.ip_address
It's the NITB's address, so it should go in the nitb.* scope.

Change-Id: I71a5ef153b7156b0644253f5aa8a0c848f42ab3b
2017-05-29 00:18:43 +02:00
Neels Hofmeyr c4ba4a6866 rename more items from nitb to bsc
A NITB is a BSC + MSC, and if a BTS talks to a NITB, it talks to the BSC part
of the NITB. Hence it makes more sense to name certain things 'bsc' instead of
'nitb', to prepare for a separate BSC process appearing soon.

Change-Id: I6a0343b9243b166d4053cc44f523543f1245d772
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 76d8103bfb rename resource nitb_iface to ip_address
I would like to use the IP addresses also for OsmoBSC processes, so it is more
than clear now that 'nitb_iface' was the wrong naming choice.

The only distinction we may need in the future is public versus loopback
interface. To add that, we may add a trait to the 'ip_address' resource
like:

  ip_address:
  - addr: 10.42.42.1
    type: public
  - addr: 127.0.0.1
    type: loopback

This way we can substitute public vs loopback addresses flexibly (e.g. using
scenarios).

Change-Id: I3ad583ae7a33f7a7bb56fe78a125f73c56a0e860
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 943c81d878 debug: config logging before templates: use pprint and an all-caps label
Change-Id: I0e1c1d3ce8163d5b40c17b7d0fb0847a068ced76
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 6d8e485a2b nitb config: set: logging color 1, category 1
Change-Id: Icd9022f5732caac65d16fc49f2ed7833199523de
2017-05-29 00:18:43 +02:00
Neels Hofmeyr 2d1d561eeb resource error logging that is easier to understand
Log what a suite requested, what it has reserved and the complete resource
state.

Change-Id: Ic6887bbe5fe74a73f0e344cd4078dd7ed989cc15
2017-05-29 00:18:42 +02:00
Pau Espin 927344b4dc event_loop: Create a global event loop to poll and wait for events
Tweaked-by: nhofmeyr
Change-Id: Iaa78bae0f053496377609b24a11ebaef3fd77598
2017-05-25 17:25:09 +00:00
Neels Hofmeyr 095d1290a6 resources.conf: remove unused example BTS
Change-Id: I370789a4dc048cf71c1951f2eb70bfec261583a2
2017-05-25 04:09:20 +02:00
Neels Hofmeyr 391afe3b13 remove bts_ocpthy.py
We're not currently paying attention to the octphy in osmo-gsm-tester. So
instead of maintaining dead code, remove the bts_octphy.py; we can re-add when
the octphy is implemented properly.

Change-Id: Ia5d5750d440ae7019634b51fa1efe7bbb2a1d1e2
2017-05-25 04:09:20 +02:00
Neels Hofmeyr 8b915073ae osmo_nitb.py: remove unused imports
Change-Id: I55c118c6b277a2c8cddc251e3d36571b12504266
2017-05-25 04:09:20 +02:00
Neels Hofmeyr 62a5600051 contrib/jenkins: don't package /share/doc/libosmocore
Change-Id: Ibd2674c3f65f820a72d77c40a9e9df3e094bb41d
2017-05-25 04:09:20 +02:00
Neels Hofmeyr 1eb5cbc719 fix: contrib/jenkins sysmobts build: proper PKG_CONFIG_PATH
Change-Id: I94b706d664ba89b2ea999601ba67348973c3639c
2017-05-24 16:17:58 +00:00
Pau Espin 5bf66c57d6 trial.py: Remove accidental double creation of file
This file is already created in run_suites().
Creating it in here too makes a new file name()_2.xml created and
populated instead of the original name().xml one.

Change-Id: Ibec14a1ef5fd029aa37ce666d00236bb872d636e
2017-05-24 12:02:43 +00:00
Pau Espin 98df394fc6 Exit with failure if not enough resources are found
Change-Id: I9e38435ff71416585a259c823053bd07c670d495
2017-05-24 12:01:07 +00:00
Pau Espin d1f8fe689e osmo_nitb.py: Remove unused var
Change-Id: Ifb0c274aac9f8fda177992f19146807387485627
2017-05-22 22:00:14 +00:00
Pau Espin 374e8a0b26 suite.py: Fix typo in variable name used during exception
Fixes a possible double exception introduced in 0ffb4144

Change-Id: I44a30f51c23e6a57ccae3483c806c0ed25d2ecf9
2017-05-22 17:52:09 +02:00
Pau Espin 469316fae0 Handle termination signals to exit gracefully and prevent resource leak
Make sure we free the reserved resources and kill launched subprocesses
before stopping. Before this patch it was not the case for instance if we
received a SIGTREM signal from kill.

Change-Id: I039e4d1908a04bf606b101ddc6a186ba67e6178e
2017-05-19 14:40:18 +02:00
Pau Espin 0ffb414406 Add JUnit XML reports; refactor test reporting
* Add Junit output file support
* Differentiate between an expected failure test and an error in the
test, as described in JUnit.
* In case of an error/exception during test, record and attach it to the
Test object and continue running the tests, and show it at the end
during the trial report.

Change-Id: Iedf6d912b3cce3333a187a4ac6d5c6b70fe9d5c5
2017-05-19 14:22:39 +02:00
Pau Espin 023fd2c748 pcap_recorder: use self.filters instead of gen_filter
Change-Id: I53779d521fbeed7c37bcaeb12be2531e4dbc005c
2017-05-15 15:01:15 +02:00
Pau Espin 6ab98983bd Enable GSMTAP on BTS and record it on the main unit NITB
Change-Id: I057a83bc20c5e664ac1778812452f189166919ba
2017-05-15 14:57:42 +02:00
Pau Espin 8cd347b2c5 nitb: Filter ssh packets in pcap
Change-Id: I62a6ae7bd3a84baceb684c26727d2269c86ed023
2017-05-15 14:49:22 +02:00
Neels Hofmeyr 95fd67374c pcap: pass complete filter string to PcapRecorder
Composing the filter in gen_filter() is more complex than we need. We pass the
address and potentially further filter elements separately, and then
gen_filter() has to guess how to combine these. Instead, have just a filter
string to use right from the start, so that the caller has full control (and
full responsibility).

Remove the addr argument, which was only used for filtering.

This is my conclusion of looking at the patches with change Ids
I62a6ae7bd3a84baceb684c26727d2269c86ed023 (PS 1) and
Icbb0f8d2058fa7ebb7f0f731645f9266cacdb120

I62... PS 2 will add the SSH filtering.

The name 'filter' is a python built-in, which is why I chose the argument
name 'filters' instead. It works with 'filter' as well, but let's try to
avoid naming conflicts like that.

Change-Id: Iff7ddf51d3bf0189ce07b488a3dcdcfce6907aba
2017-05-15 14:49:22 +02:00
Neels Hofmeyr bcd4332b6b jenkins-run: clean up also upon error
Change-Id: I949849d85d93cb47c839cd738788cf6f9b22fc12
2017-05-15 14:25:24 +02:00
Neels Hofmeyr e44a0cb0d9 trial: always use abspath
No actual failure known, but using the abspath will prevent further problems
when running a binary in its own run dir and passing trial paths to it.

Adjust test expectations.

Change-Id: Ia2ba876a42eef9122a92645edd1f28ddb56e6be3
2017-05-15 14:25:24 +02:00
Neels Hofmeyr e60df6961c fix name of local var, to not shadow 'suite' module
This caused "UnboundLocalError: local variable 'suite' referenced before
assignment".

Change-Id: Ic9aa383f5cdc9818c5a21b101fb6ddea4132d9fb
2017-05-15 12:23:57 +00:00
Neels Hofmeyr 2123541574 fix: exception outside of trial run should be logged and cause nonzero rc
From an earlier stage of the code, there was still an exception catcher that
makes no sense. Remove it.

Change-Id: I8085318c91b06a3e8f7d3f8cfdd15a99650666e2
2017-05-15 12:23:57 +00:00
Neels Hofmeyr b06485fcad cosmetic: contrib: add 'build-' to script names
Distinguish the scripts that build binaries from the others by adding "build-"
to their names.

Change-Id: I0c3b0c06210f5cb6a936c5e90ebc9167b57eeae2
2017-05-15 12:23:57 +00:00
Neels Hofmeyr c59e079573 contrib: rethink jenkins jobs with build slave approach
Previously, the idea was to run a test remotely via SSH. This has moved to
operating an actual jenkins build slave on the main unit, which simplifies
things.

Also, previously (in the old osmo-gsm-tester), there was a daemon running,
accepting new trials by a directory appearing. Now, we're directly launching a
test run, which simplifies things.

Remove all SSH stuff from the "run" script.

Compose the checksums of the built binary-tars in the actual build jobs. In the
"run" job, only combine those checksums to one file. (Otherwise we would
compose the sums after transmitting over the network to the build slave.)

Instead of storing trials in a common location on the system, just keep one
trial in the workspace per run. After the run, tar up the trial dir to enable
easy archiving of build results.

The common location on the system might still be a good idea if we're one day
going to move to concurrent runs with scheduling of hardware resources, but so
far we're having simple one-shot runs.

Change-Id: I129f5189ce2bebd761bc752b158fb8778b31010e
2017-05-15 12:23:57 +00:00
Neels Hofmeyr 0765098946 checkout dependencies from script
The jenkins jobs used to have multiple source repositories configured, but it
is really cumbersome to add all the SCM links to a jenkins job.

Instead, clone the git sources from the script, as we also do in various other
contrib/ scripts.

This partly duplicates the osmo-ci scripts, but since this code is much more
intended to run on other peoples' jenkins instances, rather keep the osmo-ci
dependency out of here.

Change-Id: Ie05cb9cd2bd884f72cbdbcc96d9c4389ffca7357
2017-05-15 12:23:57 +00:00
Neels Hofmeyr 143ab81aac pcap recorder: include vim indenting rules as comment
Change-Id: Idbc4521053610d55c9c32eff950ed8fa68dda171
2017-05-15 12:23:36 +00:00
Neels Hofmeyr 39b0b89caf log the location of the detailed log file
The idea is that if someone reads the short log and scratches her head, she can
notice that there is a more detailed log available.

Change-Id: Id5f443f1af0dc774d4d4c588a238b786a83e44d3
2017-05-15 12:22:35 +00:00
Neels Hofmeyr 2296883fc3 log: tweak osmo-gsm-tester.py stdout: all_origins=False, src=False
Change-Id: I24a600f67f7a9f3d1235abfceb86f311ffa97746
2017-05-15 12:22:35 +00:00
Neels Hofmeyr 7e2e8f1d65 log state dir
On the log output, clearly show which state dir is used. Since all runs should
use the same state dir, this is important and/or reassuring to see.

Change-Id: Ie92f1879a35d8bb399ee916b7ef72f9ee7d47409
2017-05-15 12:22:35 +00:00
Neels Hofmeyr 619447404f debug suite: add test that deliberately fails
Change-Id: I42ab624f8dd8e91ee62b8eccfa451e01fd3694d0
2017-05-15 12:22:10 +00:00
Neels Hofmeyr 1fe012e6a8 cosmetic: rather have an underscore in pcap_recorder.py
Change-Id: Ib4886cb3fe0cb9c66d170097b98b4d1eb67cab81
2017-05-15 12:43:35 +02:00
Neels Hofmeyr cf0304ff26 cosmetic: cmdline help: add line breaks, fix typo
Fix typo 'patch' -> 'match'

Argparse has a peculiar way of treating the cmdline help strings. Include
explicit newlines in cmdline help, and place a comment explaining the details.

Change-Id: I34a2333c55719986b729b07386bc47314635ee04
2017-05-12 14:34:41 +02:00
Neels Hofmeyr aca2624273 paths: have one common parent dir /var/tmp/osmo-gsm-tester
In the example config and the jenkins scripts, use paths below common parent
dir /var/tmp/osmo-gsm-tester.

1. example: put the state dir in /var/tmp/osmo-gsm-tester/state, instead of in
the config dir like /etc/osmo-gsm-tester.

2. contrib scripts: place trials in /var/tmp/osmo-gsm-tester/trials, and to
move into place atomically, use /var/tmp/osmo-gsm-tester/.prep-trials as
temporary location.

The OsmoGSMTester manual is currently also being updated to setup these paths,
with /var/tmp/osmo-gsm-tester owned by a common group and having group-sticky
as well has group-writable access rules.

Change-Id: I2961e9d1d9b14859b886058b54ffcb36f4d88bc1
2017-05-11 17:39:02 +02:00
Neels Hofmeyr cceb0f56ab readme: add some ssh details
Change-Id: Idb5d254768b52300d99b5a1f11f92e8536aec371
2017-05-11 10:34:03 +00:00
Neels Hofmeyr 47de6b0a24 ofono/dbus: detach from signals as appropriate
In the dbus_connect() code path, return the subscription token.

In the Modem class, use this token to disconnect signal callbacks when an
interface is removed.

Generalize the signal connect/disconnect handling: have one tuple defining all
signals and their handler functions, add generalized loop to attach them. Store
all subscription tokens in a dict of lists, any number of signal callbacks per
general interface name. When an interface is announced to be removed from
ofono, detach all signals for that interface implicitly.

So far this only handles the MessageManager interface's IncomingMessage signal,
but others will likely follow soon.

Fixes: OS#2242
Change-Id: I0939ef414bc599ee8742df48da04d8d9569d00ba
2017-05-11 12:33:00 +02:00
Neels Hofmeyr 803d87c2e8 util: simplify listdict
listdict came into the code base from some other python code of mine, for no
apparent reason: it is actually not used here at all. However, an upcoming
patch will use a dict of lists.

Also, the listdict implementation is convoluted/complex (to allow accessing
keys as direct object members, which we don't need). Simplify the
implementation to be used by I0939ef414bc599ee8742df48da04d8d9569d00ba.

Change-Id: I09adfd128a19c6c5ba36aae1d4cab83dbd07e0fb
2017-05-11 12:33:00 +02:00
Neels Hofmeyr a6278b7fd0 cosmetic: lock test: add quotes
Mostly to clarify an empty lock in the end.

Change-Id: If80960b331d30125e97878d52edba9b4a63e87c7
2017-05-11 12:33:00 +02:00
Neels Hofmeyr 2321a19aa5 lock test: make more robust against timing
Remove the stdout printing from the lock_test_help.py, so that there is no
problem with a failing test because one output ending up in stdout before the
other. So only output the current lock from lock_test.sh.

Change-Id: I7fe80a9de88ddee1d66ca5c692948fc9673e4230
2017-05-11 10:31:46 +00:00
Neels Hofmeyr 4f33dcc4df run dir: add a second log file containing a non-debug log
Change-Id: Ic51b8f87abc52cc4af3672ee70045ba08334f62e
2017-05-10 13:08:52 +00:00