Skip to content

net: fix stale validate.sh and portscan output filename - #96

Merged
gkaoukis merged 2 commits into
kbensh:mainfrom
gkaoukis:net-fix
Aug 30, 2026
Merged

gkaoukis merged 2 commits into
kbensh:mainfrom
gkaoukis:net-fix

Conversation

@gkaoukis

Copy link
Copy Markdown
Collaborator

net/validate.sh was written against an earlier layout of this benchmark and never updated when it landed as net/ in 65b1bc8. It resolved every path under /networking, a directory that does not exist, and checked two scripts, massvulscan and pingsweep, that the benchmark does not contain, while never validating portscan at all. The massvulscan branch additionally reported success on a missing file, since it only greps for failure strings and grep matches nothing in a file that is not there.

The net effect was that net reported [fail] unconditionally, on every OS, in Docker or bare. net is not in the CI matrix, so this went unnoticed.

Rewrite validate.sh against the three scripts execute.sh actually runs:

  • portscan: report is non-empty, carries no error markers, and lists ports 4444/5555/6666 as open, which execute.sh holds listeners on.
  • ping: loopback reports UP, and every input IP is classified UP or DOWN, counted rather than matched per IP to stay linear in the input size.
  • accept-ips: logic unchanged, path corrected.

Also fix execute.sh's chown, which named portscan_output.txt while portscan.sh writes portscan.txt, and add a namespace readiness probe so an environment that cannot enter a netns says why, instead of surfacing a bare exit code 255 and an empty output file.

net/validate.sh was written against an earlier layout of this benchmark
and never updated when it landed as net/ in 65b1bc8. It resolved every
path under /networking, a directory that does not exist, and checked
two scripts, massvulscan and pingsweep, that the benchmark does not
contain, while never validating portscan at all. The massvulscan branch
additionally reported success on a missing file, since it only greps for
failure strings and grep matches nothing in a file that is not there.

The net effect was that net reported [fail] unconditionally, on every OS,
in Docker or bare. net is not in the CI matrix, so this went unnoticed.

Rewrite validate.sh against the three scripts execute.sh actually runs:

  - portscan: report is non-empty, carries no error markers, and lists
    ports 4444/5555/6666 as open, which execute.sh holds listeners on.
  - ping: loopback reports UP, and every input IP is classified UP or
    DOWN, counted rather than matched per IP to stay linear in the
    input size.
  - accept-ips: logic unchanged, path corrected.

Also fix execute.sh's chown, which named portscan_output.txt while
portscan.sh writes portscan.txt, and add a namespace readiness probe so
an environment that cannot enter a netns says why, instead of surfacing
a bare exit code 255 and an empty output file.
@gkaoukis
gkaoukis merged commit 00d967e into kbensh:main Aug 30, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant