From 9b100024a45996bae00f858a812ed8f4c9c37a6e Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 15 Sep 2023 17:54:00 +0200 Subject: tests/shell: cleanup creating dummy interfaces in tests In "tests/shell/testcases/chains/netdev_chain_0", calling "trap ... EXIT" multiple times does not work. Fix it, by calling one cleanup function. Note that we run in separate namespaces, so the cleanup is usually not necessary. Still do it, we might want to run without unshare (via NFT_TEST_UNSHARE_CMD=""). Without unshare, it's important that the cleanup always works. In practice it might not, for example, "trap ... EXIT" does not run for SIGTERM. A leaked interface might break the follow up test and tests interfere with each other. Try to workaround that by first trying to delete the interface. Also failures to create the interfaces are not considered fatal. I don't understand under what circumstances this might fail, note that there are other tests that create dummy interface and don't "exit 77" on failure. We want to know when something odd is going on. Signed-off-by: Thomas Haller Signed-off-by: Florian Westphal --- tests/shell/testcases/chains/dumps/netdev_chain_0.nft | 3 --- 1 file changed, 3 deletions(-) (limited to 'tests/shell/testcases/chains/dumps/netdev_chain_0.nft') diff --git a/tests/shell/testcases/chains/dumps/netdev_chain_0.nft b/tests/shell/testcases/chains/dumps/netdev_chain_0.nft index bc02dc18..aa571e00 100644 --- a/tests/shell/testcases/chains/dumps/netdev_chain_0.nft +++ b/tests/shell/testcases/chains/dumps/netdev_chain_0.nft @@ -1,5 +1,2 @@ table netdev x { - chain y { - type filter hook ingress devices = { d0, d1 } priority filter; policy accept; - } } -- cgit v1.2.3