Test Suite - Namespace: Difference between revisions

From Libreswan
Jump to navigation Jump to search
(Created page with "This is a quick guide to get going to run libreswan tests under namespace. Be aware. the host would get lots of packages, need sudo without password permission == pre requist...")
 
No edit summary
Line 1: Line 1:
This is a quick guide to get going to run libreswan tests under namespace. Be aware. the host would get lots of packages, need sudo without password permission
This is a quick guide to run libreswan tests under namespace. Be aware. the host would get lots of packages, need sudo without password permission


== pre requists on the host ==
== pre requists on the host ==
=== sudo without password ===  
=== sudo without password ===  
to check run "sudo bash -c true" if it does not ask for password you are good!
to check run "sudo bash -c true" if it does not ask for password you are good!
=== install testrun dependencies ==
=== install testrun dependencies ===
<pre>
<pre>
# pre install check
# pre install check
Line 14: Line 14:


== run the test ==
== run the test ==
<pre>
<pre>
#as single test
#as single test
Line 22: Line 21:
#as testrun
#as testrun
cd /home/build/libreswan/
cd /home/build/libreswan/
# another important step generate x509 certifcates
cd /home/build/libreswan/testing/x509/ && ./dist_certs.py && cd /home/build/libreswan/
make nsrun
make nsrun
</pre>
</pre>

Revision as of 14:31, 30 July 2019

This is a quick guide to run libreswan tests under namespace. Be aware. the host would get lots of packages, need sudo without password permission

pre requists on the host

sudo without password

to check run "sudo bash -c true" if it does not ask for password you are good!

install testrun dependencies

# pre install check
sudo bash -c true
sudo make install-rpm-dep
make nsinstall #remember this will install special pluto on your host!!


run the test

#as single test
cd /home/build/libresswan/testing/pluto/basic-pluto-01
../../utils/nsrun --ns

#as testrun
cd /home/build/libreswan/
# another important step generate x509 certifcates
cd /home/build/libreswan/testing/x509/ && ./dist_certs.py && cd /home/build/libreswan/
make nsrun

useful alias/fuction

NSENTER ()
{
    ns=$1;
    nsargs="--mount=/run/mountns/${ns} --net=/run/netns/${ns} --uts=/run/utsns/${ns}";
    NSENTER_CMD="/usr/bin/nsenter ${nsargs} ";
    sudo ${NSENTER_CMD} /bin/bash
}
to enter 
NSENTER east-basic-pluto-01