Merge ~liaou3/checkbox-iiotg/+git/checkbox-provider-intliotg:add_tsn_snap_check into ~checkbox-dev/checkbox-iiotg/+git/checkbox-provider-intliotg:master

Proposed by Vincent Liao
Status: Merged
Approved by: Vincent Liao
Approved revision: 4d506c3db477260539e4b9aafb722b7dbcc81634
Merged at revision: 7a773788db1e4f84eff747340a867c46029fc7a3
Proposed branch: ~liaou3/checkbox-iiotg/+git/checkbox-provider-intliotg:add_tsn_snap_check
Merge into: ~checkbox-dev/checkbox-iiotg/+git/checkbox-provider-intliotg:master
Diff against target: 183 lines (+43/-7)
2 files modified
units/tsn/jobs.pxu (+36/-7)
units/tsn/test-plan.pxu (+7/-0)
Reviewer Review Type Date Requested Status
PeiYao Chang Approve
Patrick Liu (community) Approve
StanleyHuang Pending
Rick Wu Pending
Vic Liu Pending
Review via email: mp+454840@code.launchpad.net

Commit message

Add tsn testing snap check job

Description of the change

Add this job to check if the required snap packages are installed. Those snaps are used for tsn testing.

Submissions:
 - auto: https://certification.canonical.com/hardware/202306-31658/submission/340597/ (fail on purpose)

 - auto: https://certification.canonical.com/hardware/202306-31658/submission/340600/
 - manual: https://certification.canonical.com/hardware/202306-31658/submission/340605/

To post a comment you must log in.
Revision history for this message
Patrick Liu (patliu) wrote :

Hi Vicent,

One small question, please see my in-line comment.

review: Needs Fixing
Revision history for this message
Vincent Liao (liaou3) wrote :

> Hi Vicent,
>
> One small question, please see my in-line comment.

You are right. Fixed.

Revision history for this message
Patrick Liu (patliu) wrote :

LGTM

review: Approve
Revision history for this message
PeiYao Chang (baconyao) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/units/tsn/jobs.pxu b/units/tsn/jobs.pxu
2index b422172..3bd09c6 100644
3--- a/units/tsn/jobs.pxu
4+++ b/units/tsn/jobs.pxu
5@@ -27,6 +27,31 @@ command:
6 exit "$exit_code"
7
8 unit: job
9+id: tsn/testing-snap-install-check
10+category_id: tsn
11+_summary: TSN testing snap installation check
12+_description:
13+ To check if the TSN related snap is installed
14+ - linuxptp-rt
15+ - ethtool-rt
16+ - iproute2-rt
17+depends: tsn/tsn-detected
18+plugin: shell
19+command:
20+ snap_list="linuxptp-rt ethtool-rt iproute2-rt"
21+ exit_code=0
22+ for snap in $snap_list; do
23+ if ! snap list | grep -q $snap; then
24+ echo "ERROR: snap package \"${snap}\" not found!"
25+ echo "Try install it with the command below"
26+ echo "sudo snap install ${snap} --edge --devmode"
27+ echo ""
28+ exit_code=1
29+ fi
30+ done
31+ exit $exit_code
32+
33+unit: job
34 category_id: tsn
35 id: tsn/tsn-devices
36 plugin: resource
37@@ -127,6 +152,7 @@ _purpose:
38 Use {interface} on the SUT to achieve time sync with the second machine as client
39 depends:
40 tsn/tsn-detected
41+ tsn/testing-snap-install-check
42 plugin: user-interact-verify
43 user: root
44 environ:
45@@ -151,6 +177,7 @@ _purpose:
46 Use {interface} on the SUT to achieve time sync with the second machine as master
47 depends:
48 tsn/tsn-detected
49+ tsn/testing-snap-install-check
50 plugin: user-interact-verify
51 user: root
52 environ:
53@@ -173,6 +200,7 @@ _summary:
54 Check system time sync with PTP hardware clock as client
55 depends:
56 tsn/tsn-detected
57+ tsn/testing-snap-install-check
58 tsn/ieee802.1as-2011/time-sync-between-two-system-as-client-{interface}
59 plugin: user-interact-verify
60 user: root
61@@ -206,6 +234,7 @@ _summary:
62 Check system time sync with PTP hardware clock as client
63 depends:
64 tsn/tsn-detected
65+ tsn/testing-snap-install-check
66 tsn/ieee802.1as-2011/time-sync-between-two-system-as-master-{interface}
67 plugin: user-interact-verify
68 user: root
69@@ -238,6 +267,7 @@ category_id: tsn
70 _summary: Check the packet time intervals
71 depends:
72 tsn/tsn-detected
73+ tsn/testing-snap-install-check
74 plugin: user-interact-verify
75 user: root
76 _purpose:
77@@ -267,6 +297,7 @@ category_id: tsn
78 _summary: Credit-Based Shaper algorithm check
79 depends:
80 tsn/tsn-detected
81+ tsn/testing-snap-install-check
82 plugin: shell
83 user: root
84 _purpose:
85@@ -287,6 +318,7 @@ category_id: tsn
86 _summary: Check if the streams packet are handled properly
87 depends:
88 tsn/tsn-detected
89+ tsn/testing-snap-install-check
90 plugin: user-interact-verify
91 user: root
92 _purpose:
93@@ -312,22 +344,18 @@ category_id: tsn
94 _summary: Frame preemption check
95 depends:
96 tsn/tsn-detected
97+ tsn/testing-snap-install-check
98 plugin: shell
99 user: root
100 _purpose:
101 To check if the system can setup frame preemption
102 command:
103- if ! command -v ethtool-rt.ethtool > /dev/null; then
104- echo "ERROR: snap ethtool-rt is required for this test and it's probably not installed."
105- echo "Please install it with the following command."
106- echo "$ sudo snap install ethtool-rt --edge --devmode"
107- exit 1
108- fi
109 echo "## Setting frame preemption on..."
110 ret=$(ethtool-rt.ethtool --set-frame-preemption {interface} fp on)
111 if [[ "$ret" != "0" ]]; then
112- echo "FAIL: Cannot set frame preemption via command below"
113+ echo "FAIL: Cannot set frame preemption via the command below"
114 echo "ethtool-rt.ethtool --set-frame-preemption {interface} fp on"
115+ echo ""
116 exit 1
117 fi
118 echo "## Showing frame preemption settings..."
119@@ -335,5 +363,6 @@ command:
120 echo "$output"
121 if ! echo "$output" | grep -q "enabled: enabled"; then
122 echo "FAIL: frame preemption is not enabled!"
123+ echo ""
124 exit 1
125 fi
126diff --git a/units/tsn/test-plan.pxu b/units/tsn/test-plan.pxu
127index 69b1e9f..fd5653c 100644
128--- a/units/tsn/test-plan.pxu
129+++ b/units/tsn/test-plan.pxu
130@@ -16,6 +16,7 @@ bootstrap_include:
131 include:
132 tsn/tsn-detected
133 tsn/test-env-setup-for-.*
134+ tsn/testing-snap-install-check
135 nested_part:
136 tsn-ieee802.1as-2011
137 tsn-time-based-shaping
138@@ -29,6 +30,7 @@ bootstrap_include:
139 include:
140 tsn/verify-PTP-for-.*
141 tsn/test-env-setup-for-.*
142+ tsn/testing-snap-install-check
143 nested_part:
144 tsn-ieee802.1qav
145 tsn-ieee802.1qbu
146@@ -44,6 +46,7 @@ unit: test plan
147 bootstrap_include:
148 tsn/tsn-devices
149 include:
150+ tsn/testing-snap-install-check
151 tsn/ieee802.1as-2011/time-sync-between-two-system-as-client-.*
152 tsn/ieee802.1as-2011/time-sync-between-two-system-as-master-.*
153 tsn/ieee802.1as-2011/time-sync-system-clock-with-PHC-as-client-.*
154@@ -59,6 +62,7 @@ unit: test plan
155 bootstrap_include:
156 tsn/tsn-devices
157 include:
158+ tsn/testing-snap-install-check
159 tsn/time-based-shaping/udp-packet-time-check-.*
160
161 id: tsn-ieee802.1qav
162@@ -69,6 +73,7 @@ unit: test plan
163 bootstrap_include:
164 tsn/tsn-devices
165 include:
166+ tsn/testing-snap-install-check
167 tsn/ieee802.1qav/check-credit-based-shaper-.*
168
169 id: tsn-ieee802.1qbv
170@@ -79,6 +84,7 @@ unit: test plan
171 bootstrap_include:
172 tsn/tsn-devices
173 include:
174+ tsn/testing-snap-install-check
175 tsn/ieee802.1qbv/udp-traffic-check-.*
176
177 id: tsn-ieee802.1qbu
178@@ -89,4 +95,5 @@ unit: test plan
179 bootstrap_include:
180 tsn/tsn-devices
181 include:
182+ tsn/testing-snap-install-check
183 tsn/ieee802.1qbu/check-frame-preemption-.*

Subscribers

People subscribed via source and target branches