Skip to content
Snippets Groups Projects
Commit f8dca410 authored by Luis Araujo's avatar Luis Araujo
Browse files

Automate iptables-nmap test case


This commit automates the iptables-nmap test case to run from LAVA.

Signed-off-by: default avatarLuis Araujo <luis.araujo@collabora.co.uk>
parent 933871cf
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ metadata: ...@@ -9,7 +9,7 @@ metadata:
- APT - APT
- OSTree - OSTree
type: functional type: functional
exec-type: manual exec-type: automated
priority: high priority: high
maintainer: "Apertis Project" maintainer: "Apertis Project"
description: "Test the firewall using nmap from another computer." description: "Test the firewall using nmap from another computer."
...@@ -19,11 +19,14 @@ metadata: ...@@ -19,11 +19,14 @@ metadata:
- "The external computer must be connected to the same network as the target." - "The external computer must be connected to the same network as the target."
expected: 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 >Not shown: 999 filtered ports
PORT STATE SERVICE PORT STATE SERVICE
80/tcp closed http 80/tcp closed http
....
TEST_RESULT:only_http_80_closed:pass
notes: notes:
- "Make sure that you have disconnect the ethernet connection to the target - "Make sure that you have disconnect the ethernet connection to the target
...@@ -32,8 +35,19 @@ metadata: ...@@ -32,8 +35,19 @@ metadata:
a network attached to Bridged adaptor. The test cannot be run if the a network attached to Bridged adaptor. The test cannot be run if the
network is configured as NAT." network is configured as NAT."
install:
git-repos:
- url: https://gitlab.apertis.org/pkg/development/apertis-tests.git
branch: 'apertis/v2021dev2'
run: run:
steps: steps:
- "From the external computer, check filtered/open/closed ports (the nmap - "# From the external computer where the apertis-tests repository was
command can take some time):" cloned, run the following script to check filtered/open/closed ports
- "$ nmap <sac_ip>" (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+)'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment