How to run NET tests on VM environment

1. Setup VM with:

  • CPU - 4

  • Memory - 8GB

  • Hard disk - 100GB

  • Have to use DEBUG build, where we have debug macro

Setup process is described in this instruction.

Note : If you already created dilos_BASE BE according the instruction, and there is no any new tested stable version, just execute the following command:

beadm activate dilos_BASE

In other case if you have already the dilos_ISO_orig BE - make the command:

beadm activate dilos_ISO_orig

Then reboot and start the instruction from the section Step 6. Prepare VM for Tests Running:

reboot

If you have no one of these 2 BEs then start the instruction from the beginning.

Note : Create ztest user if you forgot to do it according the instruction:

sudo useradd -m -d /var/ztest -g staff -s /bin/bash ztest

sudo passwd ztest

echo "ztest ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers.d/ztest

2. Install packages for net tests:

Note : If you already did it on the previous step when preparing VM to run, then you can skip this step and go to the next one.

sudo apt update reboot sudo apt install system-test-nettest testrunner python3

3. Login by user ztest and create zones:

Zones must be created according to the file:
/opt/net-tests/config/ip_forwarding.config
Currently accepted names: cz, sz, rz

You can use the installation script or do the following steps.

First configure and install template zones cz-orig, sz-orig and rz-orig, from which test zones will be created later:

ztest@dilos:~# cat > cz-orig.cfg <<EOT create set zonepath=/zones/cz-orig set autoboot=false set ip-type=exclusive add net set physical=int1 set global-nic="vsw0" add property (name="ip",value="dhcp") add property (name="primary",value="true") end commit exit EOT ztest@dilos:~# sudo zonecfg -z cz-orig -f cz-orig.cfg sudo zoneadm -z cz-orig install 2>&1 | /usr/bin/tee -a /var/tmp/cz-orig-bts.log ztest@dilos:~# cat > sz-orig.cfg <<EOT create set zonepath=/zones/sz-orig set autoboot=false set ip-type=exclusive add net set physical=int2 set global-nic="vsw0" add property (name="ip",value="dhcp") add property (name="primary",value="true") end commit exit EOT ztest@dilos:~# sudo zonecfg -z sz-orig -f sz-orig.cfg && sudo zoneadm -z sz-orig install ztest@dilos:~# cat > rz-orig.cfg <<EOT create set zonepath=/zones/rz-orig set autoboot=false set ip-type=exclusive add net set physical=int3 set global-nic="vsw0" add property (name="ip",value="dhcp") add property (name="primary",value="true") end commit exit EOT ztest@dilos:~# sudo zonecfg -z rz-orig -f rz-orig.cfg && sudo zoneadm -z rz-orig install

You can check that zone instillation procedure was successfully by entering the following command:

grep -e 'WARNING:' -e 'warning:' -e 'W:' -e 'error:' -e 'ERROR:' /var/tmp/cz-orig-bts.log | sort -u

Now configure test zones. The following is the configuration for the cz zone:

For other zones settings will be the same. For the sz zone:

and for the rz zone:

Install the socat package for every template zone

The zones have not configured net, need to install it from the global zone. Download the package inside the global zone:

Install it into the zones:

4. Login by user ztest and run tests

Check that dhcp zone and server are running after reboot and run test zones and tests:

Wait while dynamic addresses will be received in every test zones and run tests:

for example, for cz zone you can with the command:

You will get an answer like this:

First it can be empty, then with inet 0.0.0.0 address for int0 interface here, and then with real received address - here it is inet 192.168.0.100.

The same way you can use for sz an rz zones as well.

Wait for several minutes and have found full logs at:

/var/tmp/test_results/<ISO TIME>


Running in stability mode