summaryrefslogtreecommitdiffstats
path: root/commands/networking/test/test_net.sh
blob: 6390f7701b8061909c16d2571343d66c35939f3b (plain)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
#!/bin/bash
#
# Copyright (C) 2014 Red Hat, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and documentation are
# those of the authors and should not be interpreted as representing official
# policies, either expressed or implied, of the FreeBSD Project.
#
# Authors: Radek Novacek <rnovacek@redhat.com>


. ./base.sh

IFS=',' read -a PORTS <<< "${LMI_NETWORKING_PORTS}"
PORT1=${PORTS[0]}
PORT2=${PORTS[1]}

rlJournalStart

rlPhaseStartSetup

rlPhaseEnd

rlPhaseStartTest "Test enumerations"
    rlLogInfo "List devices"
    rlRun -s "$LMI net device list"
    rlAssertGrep "$PORT1" $rlRun_LOG
    rlAssertGrep "$PORT2" $rlRun_LOG

    rlLogInfo "Show devices"
    rlRun -s "$LMI net device show"
    rlAssertGrep "Device $PORT1" $rlRun_LOG
    rlAssertGrep "Device $PORT2" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Test basic settings"
    rlLogInfo "List settings"
    rlRun "$LMI net setting list"
    rlRun "$LMI net setting show"

    rlLogInfo "Create setting with default options"
    rlRun "$LMI net setting create 'XXX Test' $PORT1"
    rlRun -s "$LMI net setting list"
    rlAssertGrep "XXX Test +Ethernet" $rlRun_LOG -E

    rlLogInfo "Delete setting"
    rlRun "$LMI net setting delete 'XXX Test'"
    rlRun -s "$LMI net setting list"
    rlAssertNotGrep "XXX Test" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Test static settings"
    rlLogInfo "Create setting with static IPv4"
    rlRun "$LMI net setting create 'XXX Test Static' $PORT1 --ipv4 static"
    rlRun -s "$LMI net setting list"
    rlAssertGrep "XXX Test Static +Ethernet" $rlRun_LOG -E

    rlLogInfo "Replace static IPv4 address"
    rlRun "$LMI net address replace 'XXX Test Static' 192.168.1.1 24"
    rlRun -s "$LMI net setting show 'XXX Test Static'"
    rlAssertGrep "IPv4 Address +192.168.1.1/255.255.255.0" $rlRun_LOG -E

    rlLogInfo "Add static IPv4 address"
    rlRun "$LMI net address add 'XXX Test Static' 192.168.1.2 24 192.168.1.100"
    rlRun -s "$LMI net setting show 'XXX Test Static'"
    rlAssertGrep "IPv4 Address +192.168.1.1/255.255.255.0" $rlRun_LOG -E
    rlAssertGrep "IPv4 Address +192.168.1.2/255.255.255.0 192.168.1.100" $rlRun_LOG -E

    rlLogInfo "Remove static IPv4 address"
    rlRun "$LMI net address remove 'XXX Test Static' 192.168.1.2"
    rlRun -s "$LMI net setting show 'XXX Test Static'"
    rlAssertGrep "IPv4 Address +192.168.1.1/255.255.255.0" $rlRun_LOG -E
    rlAssertNotGrep "IPv4 Address +192.168.1.2/255.255.255.0" $rlRun_LOG -E

    rlLogInfo "Delete static IPv4 setting"
    rlRun "$LMI net setting delete 'XXX Test Static'"
    rlRun -s "$LMI net setting list"
    rlAssertNotGrep "XXX Test Static" $rlRun_LOG

    rlLogInfo "Create setting with static IPv6"
    rlRun "$LMI net setting create 'XXX Test Static' $PORT1 --ipv6 static"
    rlRun -s "$LMI net setting list"
    rlAssertGrep "XXX Test Static +Ethernet" $rlRun_LOG -E

    rlLogInfo "Replace static IPv6 address"
    rlRun "$LMI net address replace 'XXX Test Static' 2001:DB8::1 32"
    rlRun -s "$LMI net setting show 'XXX Test Static'"
    rlAssertGrep "IPv6 Address +2001:DB8::1/32" $rlRun_LOG '-E -i'

    rlLogInfo "Add static IPv6 address"
    rlRun "$LMI net address add 'XXX Test Static' 2001:DB8::2 32"
    rlRun -s "$LMI net setting show 'XXX Test Static'"
    rlAssertGrep "IPv6 Address +2001:DB8::1/32" $rlRun_LOG '-E -i'
    rlAssertGrep "IPv6 Address +2001:DB8::2/32" $rlRun_LOG '-E -i'

    rlLogInfo "Remove static IPv6 address"
    rlRun "$LMI net address remove 'XXX Test Static' 2001:DB8::2"
    rlRun -s "$LMI net setting show 'XXX Test Static'"
    rlAssertGrep "IPv6 Address +2001:DB8::1/32" $rlRun_LOG '-E -i'
    rlAssertNotGrep "IPv6 Address +2001:DB8::2/32" $rlRun_LOG '-E -i'

    rlLogInfo "Delete static IPv6 setting"
    rlRun "$LMI net setting delete 'XXX Test Static'"
    rlRun -s "$LMI net setting list"
    rlAssertNotGrep "XXX Test Static" $rlRun_LOG

    rlLogInfo "Create setting with static IPv4 and IPv6"
    rlRun "$LMI net setting create 'XXX Test Static' $PORT1 --ipv4 static --ipv6 static"
    rlRun -s "$LMI net setting list"
    rlAssertGrep "XXX Test Static +Ethernet" $rlRun_LOG -E

    rlLogInfo "Delete static IPv6 setting"
    rlRun "$LMI net setting delete 'XXX Test Static'"
    rlRun -s "$LMI net setting list"
    rlAssertNotGrep "XXX Test Static" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Test DHCP(v6) settings"
    rlLogInfo "Create setting with IPv4 DHCP"
    rlRun "$LMI net setting create 'XXX Test DHCP' $PORT1 --ipv4 dhcp"
    rlRun -s "$LMI net setting list"
    rlAssertGrep "XXX Test DHCP +Ethernet" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test DHCP'"
    rlAssertGrep "IPv4 +DHCP" $rlRun_LOG -E

    rlLogInfo "Delete IPv4 DHCP setting"
    rlRun "$LMI net setting delete 'XXX Test DHCP'"
    rlRun -s "$LMI net setting list"
    rlAssertNotGrep "XXX Test DHCP" $rlRun_LOG

    rlLogInfo "Create setting with IPv6 DHCPv6"
    rlRun "$LMI net setting create 'XXX Test DHCP' $PORT1 --ipv6 dhcpv6"
    rlRun -s "$LMI net setting list"
    rlAssertGrep "XXX Test DHCP +Ethernet" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test DHCP'"
    rlAssertGrep "IPv6 +DHCPv6" $rlRun_LOG -E

    rlLogInfo "Delete IPv6 DHCPv6 setting"
    rlRun "$LMI net setting delete 'XXX Test DHCP'"
    rlRun -s "$LMI net setting list"
    rlAssertNotGrep "XXX Test DHCP" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Test setting activation"
    rlLogInfo "Create setting with DHCP IPv4 and Stateless IPv6"
    rlRun "$LMI net setting create 'XXX Test DHCP' $PORT1 --ipv4 dhcp --ipv6 stateless"

    rlLogInfo "Activate setting with port specified"
    rlRun "$LMI net activate 'XXX Test DHCP' $PORT1"
    rlRun -s "$LMI net setting show 'XXX Test DHCP'"
    rlAssertGrep "Status +Active" $rlRun_LOG -E

    rlLogInfo "Deactivate setting with port specified"
    rlRun "$LMI net deactivate 'XXX Test DHCP' $PORT1"
    rlRun -s "$LMI net setting show 'XXX Test DHCP'"
    rlAssertGrep "Status +Inactive" $rlRun_LOG -E

    rlLogInfo "Activate setting without port specified"
    rlRun "$LMI net activate 'XXX Test DHCP'"
    rlRun -s "$LMI net setting show 'XXX Test DHCP'"
    rlAssertGrep "Status +Active" $rlRun_LOG -E

    rlLogInfo "Deactivate setting without port specified"
    rlRun "$LMI net deactivate 'XXX Test DHCP'"
    rlRun -s "$LMI net setting show 'XXX Test DHCP'"
    rlAssertGrep "Status +Inactive" $rlRun_LOG -E

    rlLogInfo "Delete setting"
    rlRun "$LMI net setting delete 'XXX Test DHCP'"
    rlRun -s "$LMI net setting list"
    rlAssertNotGrep "XXX Test DHCP" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Test bridging"
    rlLogInfo "Create bridge setting"
    rlRun "$LMI net setting create 'XXX Test Bridge' $PORT1 --bridging"
    rlRun -s "$LMI net setting show 'XXX Test Bridge'"
    rlAssertGrep "Type +Bridge master" $rlRun_LOG -E
    rlAssertGrep "Slave Setting +XXX Test Bridge Slave 1" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test Bridge Slave 1'"
    rlAssertGrep "Type +Bridge slave" $rlRun_LOG -E
    rlAssertGrep "Master Setting +XXX Test Bridge" $rlRun_LOG -E
    rlAssertGrep "Device +$PORT1" $rlRun_LOG -E

    rlLogInfo "Enslave device"
    rlRun "$LMI net enslave 'XXX Test Bridge' $PORT2"
    rlRun -s "$LMI net setting show 'XXX Test Bridge'"
    rlAssertGrep "Type +Bridge master" $rlRun_LOG -E
    rlAssertGrep "Slave Setting +XXX Test Bridge Slave 1" $rlRun_LOG -E
    rlAssertGrep "Slave Setting +XXX Test Bridge Slave 2" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test Bridge Slave 2'"
    rlAssertGrep "Type +Bridge slave" $rlRun_LOG -E
    rlAssertGrep "Master Setting +XXX Test Bridge" $rlRun_LOG -E
    rlAssertGrep "Device +$PORT2" $rlRun_LOG -E

    rlLogInfo "Activate bridge"
    rlRun "$LMI net activate 'XXX Test Bridge'"
    rlRun -s "$LMI net setting show 'XXX Test Bridge'"
    rlAssertGrep "Status +Active" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test Bridge Slave 1'"
    rlAssertGrep "Status +Active" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test Bridge Slave 2'"
    rlAssertGrep "Status +Active" $rlRun_LOG -E

    rlLogInfo "Deactivate bridge"
    rlRun "$LMI net deactivate 'XXX Test Bridge'"
    rlRun -s "$LMI net setting show 'XXX Test Bridge'"
    rlAssertGrep "Status +Inactive" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test Bridge Slave 1'"
    rlAssertGrep "Status +Inactive" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test Bridge Slave 2'"
    rlAssertGrep "Status +Inactive" $rlRun_LOG -E

    rlLogInfo "Delete bridge"
    rlRun "$LMI net setting delete 'XXX Test Bridge'"
    rlRun -s "$LMI net setting list"
    rlAssertNotGrep "XXX Test Bridge" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Test bonding"
    rlLogInfo "Create bonding setting"
    rlRun "$LMI net setting create 'XXX Test Bond' $PORT1 --bonding"
    rlRun -s "$LMI net setting show 'XXX Test Bond'"
    rlAssertGrep "Type +Bond master" $rlRun_LOG -E
    rlAssertGrep "Slave Setting +XXX Test Bond Slave 1" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test Bond Slave 1'"
    rlAssertGrep "Type +Bond slave" $rlRun_LOG -E
    rlAssertGrep "Master Setting +XXX Test Bond" $rlRun_LOG -E
    rlAssertGrep "Device +$PORT1" $rlRun_LOG -E

    rlLogInfo "Enslave device"
    rlRun "$LMI net enslave 'XXX Test Bond' $PORT2"
    rlRun -s "$LMI net setting show 'XXX Test Bond'"
    rlAssertGrep "Type +Bond master" $rlRun_LOG -E
    rlAssertGrep "Slave Setting +XXX Test Bond Slave 1" $rlRun_LOG -E
    rlAssertGrep "Slave Setting +XXX Test Bond Slave 2" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test Bond Slave 2'"
    rlAssertGrep "Type +Bond slave" $rlRun_LOG -E
    rlAssertGrep "Master Setting +XXX Test Bond" $rlRun_LOG -E
    rlAssertGrep "Device +$PORT2" $rlRun_LOG -E

    rlLogInfo "Activate bond"
    rlRun "$LMI net activate 'XXX Test Bond'"
    rlRun -s "$LMI net setting show 'XXX Test Bond'"
    rlAssertGrep "Status +Active" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test Bond Slave 1'"
    rlAssertGrep "Status +Active" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test Bond Slave 2'"
    rlAssertGrep "Status +Active" $rlRun_LOG -E

    rlLogInfo "Deactivate bond"
    rlRun "$LMI net deactivate 'XXX Test Bond'"
    rlRun -s "$LMI net setting show 'XXX Test Bond'"
    rlAssertGrep "Status +Inactive" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test Bond Slave 1'"
    rlAssertGrep "Status +Inactive" $rlRun_LOG -E
    rlRun -s "$LMI net setting show 'XXX Test Bond Slave 2'"
    rlAssertGrep "Status +Inactive" $rlRun_LOG -E

    rlLogInfo "Delete bond"
    rlRun "$LMI net setting delete 'XXX Test Bond'"
    rlRun -s "$LMI net setting list"
    rlAssertNotGrep "XXX Test Bond" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Test static routes"
    rlLogInfo "Create test setting"
    rlRun "$LMI net setting create 'XXX Test' $PORT1 --ipv4 static --ipv6 static"

    rlLogInfo "Add static IPv4 route"
    rlRun "$LMI net route add 'XXX Test' 192.168.100.1 24"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertGrep "IPv4 Static Route +192.168.100.1/255.255.255.0 0 0.0.0.0" $rlRun_LOG -E

    rlLogInfo "Add another static IPv4 route"
    rlRun "$LMI net route add 'XXX Test' 192.168.100.2 24 100"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertGrep "IPv4 Static Route +192.168.100.1/255.255.255.0 0 0.0.0.0" $rlRun_LOG -E
    rlAssertGrep "IPv4 Static Route +192.168.100.2/255.255.255.0 100 0.0.0.0" $rlRun_LOG -E

    rlLogInfo "Replace static IPv4 route"
    rlRun "$LMI net route replace 'XXX Test' 192.168.100.3 24 100 192.168.100.30"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertNotGrep "IPv4 Static Route +192.168.100.1" $rlRun_LOG -E
    rlAssertNotGrep "IPv4 Static Route +192.168.100.2" $rlRun_LOG -E
    rlAssertGrep "IPv4 Static Route +192.168.100.3/255.255.255.0 100 192.168.100.30" $rlRun_LOG -E

    rlLogInfo "Remove static IPv4 route"
    rlRun "$LMI net route remove 'XXX Test' 192.168.100.3"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertNotGrep "IPv4 Static Route +192.168.100.3" $rlRun_LOG "-E -i"

    rlLogInfo "Add static IPv6 route"
    rlRun "$LMI net route add 'XXX Test' 2001:DB8::1 32"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertGrep "IPv6 Static Route +2001:DB8::1/32 0 ::" $rlRun_LOG "-E -i"

    rlLogInfo "Add another static IPv6 route"
    rlRun "$LMI net route add 'XXX Test' 2001:DB8::2 32 100"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertGrep "IPv6 Static Route +2001:DB8::1/32 0 ::" $rlRun_LOG "-E -i"
    rlAssertGrep "IPv6 Static Route +2001:DB8::2/32 100" $rlRun_LOG "-E -i"

    rlLogInfo "Replace static IPv6 route"
    rlRun "$LMI net route replace 'XXX Test' 2001:DB8::3 32 100 2001:DB8::30"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertNotGrep "IPv6 Static Route +2001:DB8::1" $rlRun_LOG "-E -i"
    rlAssertNotGrep "IPv6 Static Route +2001:DB8::2" $rlRun_LOG "-E -i"
    rlAssertGrep "IPv6 Static Route +2001:DB8::3/32 100 2001:DB8::30" $rlRun_LOG "-E -i"

    rlLogInfo "Remove static IPv6 route"
    rlRun "$LMI net route remove 'XXX Test' 2001:DB8::3"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertNotGrep "IPv6 Static Route +2001:DB8::3" $rlRun_LOG "-E -i"

    rlLogInfo "Delete test setting"
    rlRun "$LMI net setting delete 'XXX Test'"
    rlRun -s "$LMI net setting list"
    rlAssertNotGrep "XXX Test" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Test setup DNS servers"
    rlLogInfo "Create test setting"
    rlRun "$LMI net setting create 'XXX Test' $PORT1 --ipv4 static --ipv6 static"

    rlLogInfo "Add IPv4 DNS server"
    rlRun "$LMI net dns add 'XXX Test' 192.168.100.1"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertGrep "DNS Server +192.168.100.1" $rlRun_LOG -E

    rlLogInfo "Add another IPv4 DNS server"
    rlRun "$LMI net dns add 'XXX Test' 192.168.100.2"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertGrep "DNS Server +192.168.100.1" $rlRun_LOG -E
    rlAssertGrep "DNS Server +192.168.100.2" $rlRun_LOG -E

    rlLogInfo "Remove IPv4 DNS server"
    rlRun "$LMI net dns remove 'XXX Test' 192.168.100.1"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertNotGrep "DNS Server +192.168.100.1" $rlRun_LOG -E
    rlAssertGrep "DNS Server +192.168.100.2" $rlRun_LOG -E

    rlLogInfo "Replace IPv4 DNS server"
    rlRun "$LMI net dns replace 'XXX Test' 192.168.100.3"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertNotGrep "DNS Server +192.168.100.1" $rlRun_LOG -E
    rlAssertNotGrep "DNS Server +192.168.100.2" $rlRun_LOG -E
    rlAssertGrep "DNS Server +192.168.100.3" $rlRun_LOG -E

    rlLogInfo "Add IPv6 DNS server"
    rlRun "$LMI net dns add 'XXX Test' 2001:DB8::1"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertGrep "DNS Server +2001:DB8::1" $rlRun_LOG "-E -i"

    rlLogInfo "Add another IPv6 DNS server"
    rlRun "$LMI net dns add 'XXX Test' 2001:DB8::2"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertGrep "DNS Server +2001:DB8::1" $rlRun_LOG "-E -i"
    rlAssertGrep "DNS Server +2001:DB8::2" $rlRun_LOG "-E -i"

    rlLogInfo "Remove IPv6 DNS server"
    rlRun "$LMI net dns remove 'XXX Test' 2001:DB8::1"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertNotGrep "DNS Server +2001:DB8::1" $rlRun_LOG "-E -i"
    rlAssertGrep "DNS Server +2001:DB8::2" $rlRun_LOG "-E -i"

    rlLogInfo "Replace IPv6 DNS server"
    rlRun "$LMI net dns replace 'XXX Test' 2001:DB8::3"
    rlRun -s "$LMI net setting show 'XXX Test'"
    rlAssertNotGrep "DNS Server +2001:DB8::1" $rlRun_LOG "-E -i"
    rlAssertNotGrep "DNS Server +2001:DB8::2" $rlRun_LOG "-E -i"
    rlAssertGrep "DNS Server +2001:DB8::3" $rlRun_LOG "-E -i"

    rlLogInfo "Delete test setting"
    rlRun "$LMI net setting delete 'XXX Test'"
    rlRun -s "$LMI net setting list"
    rlAssertNotGrep "XXX Test" $rlRun_LOG
rlPhaseEnd

rlJournalPrintText
rlJournalEnd