From f8dca4106f982c44dc5c1a56d590369cc9802887 Mon Sep 17 00:00:00 2001 From: Luis Araujo <luis.araujo@collabora.co.uk> Date: Mon, 2 Mar 2020 23:37:02 +0800 Subject: [PATCH] Automate iptables-nmap test case This commit automates the iptables-nmap test case to run from LAVA. Signed-off-by: Luis Araujo <luis.araujo@collabora.co.uk> --- test-cases/iptables-nmap.yaml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/test-cases/iptables-nmap.yaml b/test-cases/iptables-nmap.yaml index 4a5daf7..dcc96a7 100644 --- a/test-cases/iptables-nmap.yaml +++ b/test-cases/iptables-nmap.yaml @@ -9,7 +9,7 @@ metadata: - APT - OSTree type: functional - exec-type: manual + exec-type: automated priority: high maintainer: "Apertis Project" description: "Test the firewall using nmap from another computer." @@ -19,11 +19,14 @@ metadata: - "The external computer must be connected to the same network as the target." expected: - - "All ports are filtered, except port 80/tcp (http) which is closed." + - "All ports are filtered, except port 80/tcp (http) which is closed. The + script should report 'pass'" - | >Not shown: 999 filtered ports PORT STATE SERVICE 80/tcp closed http + .... + TEST_RESULT:only_http_80_closed:pass notes: - "Make sure that you have disconnect the ethernet connection to the target @@ -32,8 +35,19 @@ metadata: a network attached to Bridged adaptor. The test cannot be run if the network is configured as NAT." +install: + git-repos: + - url: https://gitlab.apertis.org/pkg/development/apertis-tests.git + branch: 'apertis/v2021dev2' + run: steps: - - "From the external computer, check filtered/open/closed ports (the nmap - command can take some time):" - - "$ nmap <sac_ip>" + - "# From the external computer where the apertis-tests repository was + cloned, run the following script to check filtered/open/closed ports + (the nmap command can take some time). Replace 'lava-target-ip' by the + DUT_IP:" + - cd apertis-tests + - iptables-nmap/run-iptables-nmap.py `lava-target-ip` + +parse: + pattern: 'TEST_RESULT:(?P<test_case_id>[^:]+):(?P<result>\w+)' -- GitLab