netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: netfilter-devel@vger.kernel.org
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
	Florian Westphal <fw@strlen.de>, Jan Engelhardt <jengelh@inai.de>
Subject: [iptables PATCH 08/12] tests: libxt_tos.t, libxt_TOS.t: Add missing masks in output
Date: Thu,  6 Oct 2022 02:27:58 +0200	[thread overview]
Message-ID: <20221006002802.4917-9-phil@nwl.cc> (raw)
In-Reply-To: <20221006002802.4917-1-phil@nwl.cc>

Mask differs between numeric --set-tos values and symbolic ones, make
sure it is covered by the tests.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 extensions/libxt_TOS.t | 12 ++++++------
 extensions/libxt_tos.t |  8 ++++----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/extensions/libxt_TOS.t b/extensions/libxt_TOS.t
index ae8531cc582e2..9f8e33fda7116 100644
--- a/extensions/libxt_TOS.t
+++ b/extensions/libxt_TOS.t
@@ -1,15 +1,15 @@
 :PREROUTING,INPUT,FORWARD,OUTPUT,POSTROUTING
 *mangle
--j TOS --set-tos 0x1f;=;OK
+-j TOS --set-tos 0x1f;-j TOS --set-tos 0x1f/0xff;OK
 -j TOS --set-tos 0x1f/0x1f;=;OK
 # maximum TOS is 0x1f (5 bits)
 # ERROR: should fail: iptables -A PREROUTING -t mangle -j TOS --set-tos 0xff
 # -j TOS --set-tos 0xff;;FAIL
--j TOS --set-tos Minimize-Delay;-j TOS --set-tos 0x10;OK
--j TOS --set-tos Maximize-Throughput;-j TOS --set-tos 0x08;OK
--j TOS --set-tos Maximize-Reliability;-j TOS --set-tos 0x04;OK
--j TOS --set-tos Minimize-Cost;-j TOS --set-tos 0x02;OK
--j TOS --set-tos Normal-Service;-j TOS --set-tos 0x00;OK
+-j TOS --set-tos Minimize-Delay;-j TOS --set-tos 0x10/0x3f;OK
+-j TOS --set-tos Maximize-Throughput;-j TOS --set-tos 0x08/0x3f;OK
+-j TOS --set-tos Maximize-Reliability;-j TOS --set-tos 0x04/0x3f;OK
+-j TOS --set-tos Minimize-Cost;-j TOS --set-tos 0x02/0x3f;OK
+-j TOS --set-tos Normal-Service;-j TOS --set-tos 0x00/0x3f;OK
 -j TOS --and-tos 0x12;-j TOS --set-tos 0x00/0xed;OK
 -j TOS --or-tos 0x12;-j TOS --set-tos 0x12/0x12;OK
 -j TOS --xor-tos 0x12;-j TOS --set-tos 0x12/0x00;OK
diff --git a/extensions/libxt_tos.t b/extensions/libxt_tos.t
index ccbe80099bdd9..6cceeeb4adbd8 100644
--- a/extensions/libxt_tos.t
+++ b/extensions/libxt_tos.t
@@ -4,10 +4,10 @@
 -m tos --tos Maximize-Reliability;-m tos --tos 0x04/0x3f;OK
 -m tos --tos Minimize-Cost;-m tos --tos 0x02/0x3f;OK
 -m tos --tos Normal-Service;-m tos --tos 0x00/0x3f;OK
--m tos --tos 0xff;=;OK
--m tos ! --tos 0xff;=;OK
--m tos --tos 0x00;=;OK
--m tos --tos 0x0f;=;OK
+-m tos --tos 0xff;-m tos --tos 0xff/0xff;OK
+-m tos ! --tos 0xff;-m tos ! --tos 0xff/0xff;OK
+-m tos --tos 0x00;-m tos --tos 0x00/0xff;OK
+-m tos --tos 0x0f;-m tos --tos 0x0f/0xff;OK
 -m tos --tos 0x0f/0x0f;=;OK
 -m tos --tos wrong;;FAIL
 -m tos;;FAIL
-- 
2.34.1


  parent reply	other threads:[~2022-10-06  0:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06  0:27 [iptables PATCH 00/12] Speed up iptables-tests.py Phil Sutter
2022-10-06  0:27 ` [iptables PATCH 01/12] tests: iptables-test: Implement fast test mode Phil Sutter
2022-10-06  6:13   ` Jan Engelhardt
2022-10-06 11:21     ` Phil Sutter
2022-10-06  0:27 ` [iptables PATCH 02/12] tests: iptables-test: Cover for obligatory -j CONTINUE in ebtables Phil Sutter
2022-10-06  0:27 ` [iptables PATCH 03/12] tests: *.t: Fix expected output for simple calls Phil Sutter
2022-10-06  0:27 ` [iptables PATCH 04/12] tests: *.t: Fix for hexadecimal output Phil Sutter
2022-10-06  0:27 ` [iptables PATCH 05/12] tests: libebt_redirect.t: Plain redirect prints with trailing whitespace Phil Sutter
2022-10-06  0:27 ` [iptables PATCH 06/12] tests: libxt_length.t: Fix odd use-case output Phil Sutter
2022-10-06  0:27 ` [iptables PATCH 07/12] tests: libxt_recent.t: Add missing default values Phil Sutter
2022-10-06  0:27 ` Phil Sutter [this message]
2022-10-06  0:27 ` [iptables PATCH 09/12] tests: libebt_vlan.t: Drop trailing whitespace from rules Phil Sutter
2022-10-06  0:28 ` [iptables PATCH 10/12] tests: libxt_connlimit.t: Add missing --connlimit-saddr Phil Sutter
2022-10-06  0:28 ` [iptables PATCH 11/12] extensions: Do not print all-one's netmasks Phil Sutter
2022-10-06  6:27   ` Jan Engelhardt
2022-10-06 11:54     ` Phil Sutter
2022-10-06 19:01       ` Jan Engelhardt
2022-10-06  0:28 ` [iptables PATCH 12/12] extensions: NFQUEUE: Do not print default queue number 0 Phil Sutter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221006002802.4917-9-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=fw@strlen.de \
    --cc=jengelh@inai.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).