[Swan-dev] regarding: testing: adding missing : ==== end ==== to nicinit

Antony Antony antony at phenome.org
Tue Jan 28 15:22:51 UTC 2020


On Tue, Jan 28, 2020 at 09:19:52AM -0500, Andrew Cagney wrote:
> On Tue, 28 Jan 2020 at 06:31, Antony Antony <antony at phenome.org> wrote:
> >
> > the markers should be used in nicinit for simple tests where we use
> > eastinit.sh, nicinit.sh and final.sh
> 
> why

Lets start from the basics. For the record I am not involving swantest or 
anything else. Leave it alone for now! Just look at testing.lirbeswan.org, 
or  "make kvm-test"

Paul was refering to commit:
https://github.com/libreswan/libreswan/commit/acbcf816e6b3ea3d5a697f6fb5df322d3822582e

I added " : ==== end ===="  in nicinit. Now look at the result after and 
before.

After:
https://testing.libreswan.org/v3.28-1532-g9082d2f910-master/certoe-04-poc-packet/nic.console.txt
iptables -t nat -F
nic #
 iptables -F
nic #
 echo initdone
initdone

Before:
https://testing.libreswan.org/v3.28-1525-g757fa8d7c3-master/certoe-04-poc-packet/OUTPUT/nic.console.txt
iptables -t nat -F
nic #
 iptables -F
nic #
nic #
 ../bin/check-for-core.sh
nic #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi

If the nic does not need final.sh it can be sanitized away using 
": ==== end ====" marker. 

There are cases where you need something like final.sh on nic that is fine.  
But majority of test cases where it is not needed, better use 
": ==== end ===="
And it is better split to nn-<host>[-foo*].sh tests.

Here is case with out ": ==== end ====" in nicinit.sh
https://testing.libreswan.org/v3.28-1525-g757fa8d7c3-master/certoe-03-cop-whack/OUTPUT/nic.console.txt

If we add  acbcf816e6b3e commit to certoe-03-cop-whack that nic.console.txt 
will be much cleaner. and can avoid lines such as the following in the 
final.sh
hostname | grep nic > /dev/null || ipsec whack --trafficstatus

I argue 8a628e94cbb7 "hostname | grep nic" is the wrong direction to go.


For stats:
grep "==== end ==="  */nicinit.sh |wc -l
286

grep ausearch */nic.console.txt |wc -l
18

so why not use ": ==== end ===="?
Why do you think it is a bad idea?

AFIK markers are not part of test kvmrunner, afik it is part of the 
sanitizer. If my argument is correct, a logical step would be - the 
kvmrunner check for ": ==== end ====" in nicinit.sh, if it finds it can 
avoid running final.sh on nic, possibly can shave off a second or two.
But that is minor optimization. 

-antony


More information about the Swan-dev mailing list