blob: 3ee6ae6ef62f40a753200de486f386a677ced30a [file] [log] [blame]
Neels Hofmeyrc0827c42017-04-23 15:04:19 +02001[[trials]]
2== Trial: Binaries to be Tested
3
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +01004A trial is a set of pre-built sysroot archives to be tested. They are typically built
Neels Hofmeyrc0827c42017-04-23 15:04:19 +02005by jenkins using the build scripts found in osmo-gsm-tester's source in the
Pau Espin Pedrolf5c83da2017-11-02 15:48:10 +01006'contrib/' dir, see <<install_add_jenkins_slave>>.
Neels Hofmeyrc0827c42017-04-23 15:04:19 +02007
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +01008A trial comes in the form of a directory containing a number of '<inst-name>.*tgz' tar
9archives (containing different sysroots) as well as a 'checksums.md5' file to
10verify the tar archives' integrity.
11
12.Example of a "trial" containing binaries built by a jenkins job
13[graphviz]
14----
15digraph G {
16 subgraph cluster_trial {
17 label = "Trial (binaries)"
18 sysmo [label="osmo-bts-sysmo.build-23.tgz\n(osmo-bts-sysmo\n+ deps\ncompiled for sysmoBTS)"]
19 trx [label="osmo-bts.build-5.tgz\n(osmo-bts-octphy + osmo-bts-trx\n+ deps\ncompiled for main unit)"]
20 nitb [label="osmo-nitb.build-42.tgz\n(osmo-nitb\n+ deps\ncompiled for main unit)"]
21 checksums [label="checksums.md5"]
22
23 checksums -> {sysmo trx nitb}
24 }
25}
26----
Neels Hofmeyrc0827c42017-04-23 15:04:19 +020027
28When the osmo-gsm-tester is invoked to run on such a trial directory, it will
29create a sub directory named 'inst' and unpack the tar archives into it.
30
31For each test run on this trial, a new subdirectory in the trial dir is
32created, named in the form of 'run.<timestamp>'. A symbolic link 'last-run'
Neels Hofmeyrb52df172017-05-14 20:09:35 +020033will point at the most recently created run dir. This run dir will accumulate:
34
35* the rendered configuration files used to run the binaries
36* stdout and stderr outputs of the binaries
Pau Espin Pedrol0b512ba2017-11-02 17:16:21 +010037* pcap files for processes doing relevant network communication
Neels Hofmeyrb52df172017-05-14 20:09:35 +020038* a test log
Pau Espin Pedrol0b512ba2017-11-02 17:16:21 +010039* jenkins parsable XML (Junit) reports
40
41The script in 'contrib/jenkins-run.sh' takes care of related tasks such as
42
43* creating the dir structure,
44* generating md5 sums for the various tar.gz containing software builds to be tested,
45* cleaning up after the build,
46* saving extra logs such as journalctl output from ofonod,
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010047* generating a final .tar.gz file with all the logs and reports to store as jenkins archives.
48
49{app-name} tests create objects to manage the allocated resources during test
50lifetime. These objects, in turn, usually run and manage processes started from
Pau Espin Pedrol6e0b6fb2020-05-25 19:49:29 +020051the trial's sysroot binaries. {app-name} provide APIs for those object classes
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010052to discover, unpack and run those binaries. An object class simply needs to
53request the name of the sysroot it wants to use (for instance 'osmo-bsc'), and
54{app-name} will take care of preparing everything and providing the sysroot path
55to it. It's a duty of the resource class to copy over the sysroot to the
56destination if the intention is to run the binary remotely on another host.
57
Pau Espin Pedrol6e0b6fb2020-05-25 19:49:29 +020058Moreover, {app-name} supports working with several different versions of a given
59sysroot by means of storing them in different subdirectories, which are later
60referenced by an object's class 'run_label' attribute named after that
61subdirectory. This way, for instance, a sysroot can be provided containing
62binaries linked against libraries present on a CentOS distribution, and other
63sysroots with the same name can also be provided which are linked against
64different versions of CentOS, or a different distro like Debian, or even a
65different arch like ARM.
66
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +010067When seeking a sysroot of a given name '<inst-name>' in the 'inst/' directory,
68{app-name} will look for 'tgz' files starting with the pattern '<inst-name>.'
69(up to the first dot). That means, suffixes are available for {app-name} user to
70identify the content, for instance having an incrementing version counter or a
71commit hash. Hence, these example files are considered valid and will be
72selected by {app-name} for 'osmo-bsc': 'osmo-bsc.tgz', 'osmo-bsc.build-23.tgz',
73'osmo-bsc.5f3e0dd2.tgz', 'osmo-bsc.armv7.build-2.tgz'. If either none or more
74than one valid file is found matching the pattern, an exception will be thrown.
Pau Espin Pedrol6e0b6fb2020-05-25 19:49:29 +020075If a 'run_label=foobar' is provided, {app-name} will look up for the 'tgz' in
76exactly the same way, but this time in 'inst/foobar/' directory instead of
77'inst/'.