Page MenuHomeFreeBSD

pf: close nc file descriptors in killstates test
Needs ReviewPublic

Authored by franco_opnsense.org on Wed, Nov 13, 7:30 PM.

Details

Summary

On an atf-sh script capture the nc process lingers and blocks
the capturing process.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 60523
Build 57407: arc lint + arc unit

Event Timeline

What do you mean by "On an atf-sh script capture"?

Consider running tests from the src tree using atf-sh (I'm using devel/atf but the base one also works with the full path I think):

sh -c 'echo $(atf-sh /usr/src/tests/sys/netpfil/pf/killstate.sh match)'

This hangs until you kill the stray nc processes. It works fine for the build of tests where nothing is forked into the background which seems to be the general issue. Another way would be to kill the nc processes when the test body ends (not in the cleanup as that would still cause it to hang), but a single line approach is likely easier although if you run the test a number of times these processes just keep building up in the system. I'm happy to improve this in any other way.

BTW, the shell-based tests are great. I want to add tests (mainly for pflog at the moment) without the test build and kyua complications.