Blame SOURCES/0016-tests-add-a-test-case-for-ether-and-vlan-listing.patch

b59ec1
From a273fd3aaf89391ac84d7a155b3bb177552bf115 Mon Sep 17 00:00:00 2001
b59ec1
From: Phil Sutter <psutter@redhat.com>
b59ec1
Date: Thu, 9 Feb 2023 10:27:57 +0100
b59ec1
Subject: [PATCH] tests: add a test case for ether and vlan listing
b59ec1
b59ec1
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2094887
b59ec1
Upstream Status: nftables commit f680055cd4377
b59ec1
b59ec1
commit f680055cd4377f2f531f5f77b3aaa7550988665d
b59ec1
Author: Florian Westphal <fw@strlen.de>
b59ec1
Date:   Mon Jul 25 19:31:22 2022 +0200
b59ec1
b59ec1
    tests: add a test case for ether and vlan listing
b59ec1
b59ec1
    before this patch series, test fails dump validation:
b59ec1
    -               update @macset { ether saddr . vlan id timeout 5s } counter packets 0 bytes 0
b59ec1
    -               ether saddr . vlan id @macset
b59ec1
    +               update @macset { @ll,48,48 . @ll,112,16 & 0xfff timeout 5s } counter packets 0 bytes 0
b59ec1
    +               @ll,48,48 . @ll,112,16 & 0xfff @macset
b59ec1
b59ec1
    Signed-off-by: Florian Westphal <fw@strlen.de>
b59ec1
b59ec1
Signed-off-by: Phil Sutter <psutter@redhat.com>
b59ec1
---
b59ec1
 tests/shell/testcases/sets/0070stacked_l2_headers  |  6 ++++++
b59ec1
 .../sets/dumps/0070stacked_l2_headers.nft          | 14 ++++++++++++++
b59ec1
 2 files changed, 20 insertions(+)
b59ec1
 create mode 100755 tests/shell/testcases/sets/0070stacked_l2_headers
b59ec1
 create mode 100644 tests/shell/testcases/sets/dumps/0070stacked_l2_headers.nft
b59ec1
b59ec1
diff --git a/tests/shell/testcases/sets/0070stacked_l2_headers b/tests/shell/testcases/sets/0070stacked_l2_headers
b59ec1
new file mode 100755
b59ec1
index 0000000..07820b7
b59ec1
--- /dev/null
b59ec1
+++ b/tests/shell/testcases/sets/0070stacked_l2_headers
b59ec1
@@ -0,0 +1,6 @@
b59ec1
+#!/bin/bash
b59ec1
+
b59ec1
+set -e
b59ec1
+dumpfile=$(dirname $0)/dumps/$(basename $0).nft
b59ec1
+
b59ec1
+$NFT -f "$dumpfile"
b59ec1
diff --git a/tests/shell/testcases/sets/dumps/0070stacked_l2_headers.nft b/tests/shell/testcases/sets/dumps/0070stacked_l2_headers.nft
b59ec1
new file mode 100644
b59ec1
index 0000000..ef254b9
b59ec1
--- /dev/null
b59ec1
+++ b/tests/shell/testcases/sets/dumps/0070stacked_l2_headers.nft
b59ec1
@@ -0,0 +1,14 @@
b59ec1
+table netdev nt {
b59ec1
+	set macset {
b59ec1
+		typeof ether saddr . vlan id
b59ec1
+		size 1024
b59ec1
+		flags dynamic,timeout
b59ec1
+	}
b59ec1
+
b59ec1
+	chain nc {
b59ec1
+		update @macset { ether saddr . vlan id timeout 5s } counter packets 0 bytes 0
b59ec1
+		ether saddr . vlan id @macset
b59ec1
+		vlan pcp 1
b59ec1
+		ether saddr 0a:0b:0c:0d:0e:0f vlan id 42
b59ec1
+	}
b59ec1
+}
b59ec1
-- 
b59ec1
2.39.1
b59ec1