Titan TTCN3 Testsuites » History » Version 9
osmith, 09/05/2018 12:32 PM
s/bcs/bsc
1 | 2 | laforge | {{>toc}} |
---|---|---|---|
2 | |||
3 | 1 | laforge | h1. Osmocom Titan TTCN3 Testsuites |
4 | |||
5 | 2 | laforge | In 2017, Osmocom started to create extensive tests suites for the Cellular Network Infrastructure elements. Those suites are written in the [[TTCN-3]] programming language and use the compiler + executor of the [[Eclipse_TITAN]] project. |
6 | |||
7 | h2. Source Code / Patches |
||
8 | |||
9 | The source code of our test suites lives in the @osmo-ttcn3-hacks@ repository |
||
10 | * cgit web interface: http://git.osmocom.org/osmo-ttcn3-hacks/ |
||
11 | * clone: @git clone git://git.osmocom.org/osmo-ttcn3-hacks@ |
||
12 | * patch review: https://gerrit.osmocom.org/#/q/project:osmo-ttcn3-hacks |
||
13 | |||
14 | We're following the [[Gerrit]] process for patch review. |
||
15 | |||
16 | h2. Test Suites |
||
17 | |||
18 | |_.Implementation under Test|_.Testsuite|_.Jenkins| |
||
19 | |bsc-nat|http://git.osmocom.org/osmo-ttcn3-hacks/tree/bsc-nat|-| |
||
20 | |[[OsmoBSC:]]|http://git.osmocom.org/osmo-ttcn3-hacks/tree/bsc|https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-bsc-test/| |
||
21 | |[[OsmoBTS:]]|http://git.osmocom.org/osmo-ttcn3-hacks/tree/bts|https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-bts-test/| |
||
22 | |[[OpenGGSN:OsmoGGSN]]|http://git.osmocom.org/osmo-ttcn3-hacks/tree/ggsn_tests|https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-ggsn-test/| |
||
23 | |[[OsmoHLR:]]|http://git.osmocom.org/osmo-ttcn3-hacks/tree/hlr|https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-hlr-test/| |
||
24 | |[[OsmoMGW:]]|http://git.osmocom.org/osmo-ttcn3-hacks/tree/mgw|https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-mgw-test/| |
||
25 | |[[OsmoMSC:]]|http://git.osmocom.org/osmo-ttcn3-hacks/tree/msc|https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-msc-test/| |
||
26 | |[[OsmoPCU:]]|http://git.osmocom.org/osmo-ttcn3-hacks/tree/pcu|-| |
||
27 | |[[OsmoSGSN:]]|http://git.osmocom.org/osmo-ttcn3-hacks/tree/sgsn|https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-sgsn-test/| |
||
28 | |[[osmo-sip-connector:]]|http://git.osmocom.org/osmo-ttcn3-hacks/tree/sip|https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-sip-test/| |
||
29 | |||
30 | h2. Running a testsuite |
||
31 | |||
32 | You have multiple options on how to execute a test suite. |
||
33 | |||
34 | h3. Running test suite in the dockerized environment |
||
35 | 1 | laforge | |
36 | 4 | osmith | This is the much easier way to run the test suite. No manual configuration of Osmocom programs or the test suite are required. Both the Osmocom program (Implementation Under Test) as well as the test suite are packaged as docker containers, which are then executed next to each other using a docker network with the "right" addresses between IUT and testsuite. |
37 | 2 | laforge | |
38 | Also, using this setup you will be guaranteed to run in the exact same environment as the automatically-executed tests on jenkins.osmocom.org, i.e. your results should be exactly identical, without any differences introduced by your runtime environment, whether specific library versions or intentional or inadvertent configuration differences. |
||
39 | |||
40 | 5 | osmith | h4. Building the docker containers |
41 | |||
42 | First install docker on your system and add yourself to the docker group. Then clone and build the containers from the "@docker-playground@ git repository":https://git.osmocom.org/docker-playground/: |
||
43 | |||
44 | <pre> |
||
45 | $ git clone git://git.osmocom.org/docker-playground |
||
46 | $ cd docker-playground |
||
47 | </pre> |
||
48 | 1 | laforge | |
49 | 6 | osmith | In theory you could run @make@ now to build all containers. However, not all of them are maintained, so this will most likely fail. Instead take a look at the Jenkins script of a specific project to figure out its dependencies and then build these containers. |
50 | 5 | osmith | |
51 | h4. Example: running the OsmoBSC testsuite |
||
52 | |||
53 | Let's assume you'd want to run the testsuite for [[OsmoBSC:]]. You would need to |
||
54 | 6 | osmith | # look at its "jenkins.sh":http://git.osmocom.org/docker-playground/tree/ttcn3-bsc-test/jenkins.sh to understand which containers are required. |
55 | 7 | osmith | # build those respective containers - at time of writing, this would be: |
56 | 1 | laforge | <pre> |
57 | 9 | osmith | $ make osmo-stp-master osmo-bsc-master osmo-bts-master ttcn3-bsc-test |
58 | 1 | laforge | </pre> |
59 | # run the @jenkins.sh@ script of the @ttcn3-bsc-test@ suite: |
||
60 | <pre> |
||
61 | 8 | osmith | $ cd ttcn3-bsc-test && ./jenkins.sh |
62 | 2 | laforge | </pre> |
63 | |||
64 | The @jenkins.sh@ script will make sure to |
||
65 | * create the needed docker network[s] |
||
66 | * run all the required containers (IUT, helpers, testsuite) |
||
67 | * shut them down after test suite execution |
||
68 | * collect the log files after execution, @/tmp/logs@ will contain them |
||
69 | 6 | osmith | |
70 | h4. Tagging images |
||
71 | |||
72 | If the build fails with a message like the following: |
||
73 | |||
74 | <pre> |
||
75 | repository docker.io/laforge/debian-jessie-build not found: does not exist or no pull access |
||
76 | </pre> |
||
77 | |||
78 | Then you need to tag your own image with the @laforge/debian-jessie-build@ name. In docker 1.13.1 this works with the following command (replace @user@ with the username that ran the @make@ command above): |
||
79 | |||
80 | <pre> |
||
81 | $ docker tag user/debian-jessie-build laforge/debian-jessie-build |
||
82 | </pre> |
||
83 | 2 | laforge | |
84 | h4. Running only a sub-set of the test cases |
||
85 | |||
86 | FIXME |
||
87 | |||
88 | h3. Running it native on your machine |
||
89 | |||
90 | This is the most complicated bit to set-up, as you will have to run the respective Osmocom Program (Implementation Under Test) in the right configuration with all the IP addresses, port numbers, config file, etc. exactly like it's expected by the test suite. |
||
91 | |||
92 | You will need a deeper understanding about how the test suite works, and what its requirement are. |
||
93 | |||
94 | h4. Running only a sub-set of the test cases |
||
95 | |||
96 | FIXME |
||
97 | |||
98 | h2. Further information |
||
99 | |||
100 | * April 2018 talk by Harald on "State of he Osmocom TTCN-3 Test Suites":https://media.ccc.de/v/UGHHW3 |