-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathREADME
146 lines (104 loc) · 5.51 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
How to run the integration tests
================================
There are 4 main steps do run Torizon OS integration tests:
1. Configure the development machine
2. Download Torizon OS images
3. Install a fresh Torizon OS image in a device (optional)
4. Run the tests
Configure the machine
=====================
First step is to install some dependencies (you may need to adapt this
command to other Linux distributions):
$ sudo apt install sshpass zstd avahi-utils openssl wget bash tar zip bc bats git
And then source the setup script:
$ source setup.sh
Download Torizon OS Easy Installer (TEZI) images
================================================
You can manually download Torizon OS Tezi images from Toradex's
Artifactory and save them on $PWD/workdir/images. In this case, the
images must be in tarball format, as downloaded from Artifactory. Also,
it is necessary to create a stamp file in the images directory so the
test scripts know the images were downloaded:
$ touch $PWD/workdir/images/.images_downloaded
Another option is to use get_tezi_images.sh script to automatically
download the images based on a specific Torizon OS version.
To use the script, open it and set the parameters to download the Tezi
images (search for CONFIGME in the script).
And then run the script:
$ ./get_tezi_images.sh
Download Common Torizon OS WIC/raw images
=====================================
You can manually download Torizon OS WIC/raw images from the Common Torizon
GitHub repository:
https://github.com/commontorizon/meta-common-torizon/releases
The images should be saved in $PWD/workdir/images, and similarly to the
TEZI instructions a stamp file must be created to indicate that the
images were downloaded.
$ touch $PWD/workdir/images/.raw_images_downloaded
There's also the option to use get_raw_images.sh to automatically
download specific Common Torizon versions according to user-defined
parameters (CONFIGME options).
Install a fresh Torizon OS image in a device
============================================
In case you also want to run test cases that requires device access,
install a fresh Torizon OS image in the device and set the default
password to '1' before running the tests.
Run the tests
=============
There is a script called run.sh that will run the integration tests
for you.
The script is configurable via environment variables, and the
following variables are available:
TCB_DEVICE: IP address of the device used in test cases that
requires device access.
TCB_PORT: SSH port of the device used in test cases that
requires device access (default port: 22)
TCB_TESTCASE: Test case to be executed, in case you want to run a
specific group of tests. If you want to run multiple
groups of tests, use a string delimited by white spaces:
"dt dto"
TCB_MACHINE: The test scripts need a Torizon OS image to run the
test cases (apalis-imx6 image is the default). With
this variable, you can select which image will be used
in the test cases, based on the defined MACHINE.
TCB_CUSTOM_IMAGE: By default, the last TorizonCore Builder version from
Docker Hub will be used to run the test cases. In case
you want to use a custom TorizonCore Builder version,
like a locally installed image, pass the name and tag
to this variable in the following format:
[registry/]<name>:<tag>
TCB_REPORT: If set to '1', it will enable the generation of a test
report in $PWD/workdir/reports.
TCB_UNDER_CI: If set to '1', some tests not appropriate for running
under CI will be skipped.
TCB_TAGS: Only run tests that match all the tags in the list (&&).
Separating the lists by space allows for logical or (||):
`a,b x,y` matches tags (a && b) || (x && y)
Following are some examples of running the test cases.
The command below will run all test cases that doesn't need a device,
using a Apalis iMX6 image:
$ ./run.sh
The command below will run all test cases that doesn't need a device,
using a Verdin iMX8MM image:
$ TCB_MACHINE=verdin-imx8mm ./run.sh
The command below will execute all test cases, including those that
requires device access (the image used in the tests will be
automatically selected based on the device):
$ TCB_DEVICE=192.168.1.210 TCB_MACHINE=apalis-imx6 DEVICE_PASSWORD=<password> ./run.sh
The command below will execute the test cases defined in
testcases/dto.bats, using an Apalis iMX6 image, and a test report
will be available in workdir/reports/:
$ TCB_REPORT=1 TCB_TESTCASE=dto TCB_MACHINE=apalis-imx6 ./run.sh
The command below will execute the test cases defined in both
testcases/dt.bats and testcases/dto.bats:
$ TCB_TESTCASE="dt dto" TCB_MACHINE=apalis-imx6 ./run.sh
The command below will execute all test cases, including those that
require device access, using a local torizoncore-builder container
tagged with 'v1':
$ TCB_CUSTOM_IMAGE=torizoncore-builder:v1 TCB_DEVICE=192.168.1.210 TCB_MACHINE=apalis-imx6 DEVICE_PASSWORD=<password> ./run.sh
The command below will execute all the tests:
$ TCB_TAGS="all" TCB_MACHINE=apalis-imx6 ./run.sh
The command below will execute untagged tests:
$ TCB_TAGS="" TCB_MACHINE=apalis-imx6 ./run.sh
The command below will execute tests tagged as 'requires-device':
$ TCB_TAGS="requires-device" TCB_DEVICE=192.168.1.210 TCB_MACHINE=apalis-imx6 DEVICE_PASSWORD=<password> ./run.sh