diff options
Diffstat (limited to 'tests/expr/byteorder')
-rw-r--r-- | tests/expr/byteorder/byteorder-0-len_err.t | 7 | ||||
-rw-r--r-- | tests/expr/byteorder/byteorder-2-len_ok.t | 7 | ||||
-rw-r--r-- | tests/expr/byteorder/byteorder-4-len_ok.t | 7 | ||||
-rw-r--r-- | tests/expr/byteorder/byteorder-8-len_ok.t | 7 | ||||
-rw-r--r-- | tests/expr/byteorder/byteorder-bad-len_err.t | 7 | ||||
-rw-r--r-- | tests/expr/byteorder/byteorder-bad-op_err.t | 7 | ||||
-rw-r--r-- | tests/expr/byteorder/byteorder-bad-size_err.t | 7 | ||||
-rw-r--r-- | tests/expr/byteorder/byteorder-no-dreg_err.t | 7 | ||||
-rw-r--r-- | tests/expr/byteorder/byteorder-no-len_err.t | 7 | ||||
-rw-r--r-- | tests/expr/byteorder/byteorder-no-op_err.t | 7 | ||||
-rw-r--r-- | tests/expr/byteorder/byteorder-no-size_err.t | 7 | ||||
-rw-r--r-- | tests/expr/byteorder/byteorder-no-sreg_err.t | 7 | ||||
-rw-r--r-- | tests/expr/byteorder/byteorder-too-large-len_err.t | 7 |
13 files changed, 91 insertions, 0 deletions
diff --git a/tests/expr/byteorder/byteorder-0-len_err.t b/tests/expr/byteorder/byteorder-0-len_err.t new file mode 100644 index 0000000..e56e1aa --- /dev/null +++ b/tests/expr/byteorder/byteorder-0-len_err.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", "0x1", NULL, NULL, NULL); +payload(NULL, "NFT_REG32_15", "1", "12", "2", NULL, NULL, NULL); +byteorder("NFT_REG32_15", "NFT_REG32_15", "0", "0", "2"); +cmp("NFT_REG32_15", "0", "0102"); +commit(); diff --git a/tests/expr/byteorder/byteorder-2-len_ok.t b/tests/expr/byteorder/byteorder-2-len_ok.t new file mode 100644 index 0000000..65f20cb --- /dev/null +++ b/tests/expr/byteorder/byteorder-2-len_ok.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", "0x1", NULL, NULL, NULL); +payload(NULL, "NFT_REG32_15", "1", "12", "2", NULL, NULL, NULL); +byteorder("NFT_REG32_15", "NFT_REG32_15", "0", "2", "2"); +cmp("NFT_REG32_15", "0", "0102"); +commit(); diff --git a/tests/expr/byteorder/byteorder-4-len_ok.t b/tests/expr/byteorder/byteorder-4-len_ok.t new file mode 100644 index 0000000..5176a4b --- /dev/null +++ b/tests/expr/byteorder/byteorder-4-len_ok.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", "0x1", NULL, NULL, NULL); +payload(NULL, "NFT_REG32_15", "1", "12", "4", NULL, NULL, NULL); +byteorder("NFT_REG32_15", "NFT_REG32_15", "0", "4", "4"); +cmp("NFT_REG32_15", "0", "01020304"); +commit(); diff --git a/tests/expr/byteorder/byteorder-8-len_ok.t b/tests/expr/byteorder/byteorder-8-len_ok.t new file mode 100644 index 0000000..3d391bc --- /dev/null +++ b/tests/expr/byteorder/byteorder-8-len_ok.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", NULL, NULL, NULL, NULL); +payload(NULL, "NFT_REG32_14", "1", "12", "8", NULL, NULL, NULL); +byteorder("NFT_REG32_14", "NFT_REG32_14", "0", "8", "8"); +cmp("NFT_REG32_14", "0", "0102030401020304"); +commit(); diff --git a/tests/expr/byteorder/byteorder-bad-len_err.t b/tests/expr/byteorder/byteorder-bad-len_err.t new file mode 100644 index 0000000..cdcf198 --- /dev/null +++ b/tests/expr/byteorder/byteorder-bad-len_err.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", "0x1", NULL, NULL, NULL); +payload(NULL, "NFT_REG32_15", "1", "12", "4", NULL, NULL, NULL); +byteorder("NFT_REG32_15", "NFT_REG32_15", "0", "8", "4"); +cmp("NFT_REG32_15", "0", "01020304"); +commit(); diff --git a/tests/expr/byteorder/byteorder-bad-op_err.t b/tests/expr/byteorder/byteorder-bad-op_err.t new file mode 100644 index 0000000..acb188b --- /dev/null +++ b/tests/expr/byteorder/byteorder-bad-op_err.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", "0x1", NULL, NULL, NULL); +payload(NULL, "NFT_REG32_15", "1", "12", "4", NULL, NULL, NULL); +byteorder("NFT_REG32_15", "NFT_REG32_15", "2", "4", "4"); +cmp("NFT_REG32_15", "0", "01020304"); +commit(); diff --git a/tests/expr/byteorder/byteorder-bad-size_err.t b/tests/expr/byteorder/byteorder-bad-size_err.t new file mode 100644 index 0000000..dcdb425 --- /dev/null +++ b/tests/expr/byteorder/byteorder-bad-size_err.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", "0x1", NULL, NULL, NULL); +payload(NULL, "NFT_REG32_15", "1", "12", "4", NULL, NULL, NULL); +byteorder("NFT_REG32_15", "NFT_REG32_15", "0", "4", "1"); +cmp("NFT_REG32_15", "0", "01020304"); +commit(); diff --git a/tests/expr/byteorder/byteorder-no-dreg_err.t b/tests/expr/byteorder/byteorder-no-dreg_err.t new file mode 100644 index 0000000..c79f25c --- /dev/null +++ b/tests/expr/byteorder/byteorder-no-dreg_err.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", "0x1", NULL, NULL, NULL); +payload(NULL, "NFT_REG32_15", "1", "12", "4", NULL, NULL, NULL); +byteorder("NFT_REG32_15", NULL, "0", "4", "4"); +cmp("NFT_REG32_15", "0", "01020304"); +commit(); diff --git a/tests/expr/byteorder/byteorder-no-len_err.t b/tests/expr/byteorder/byteorder-no-len_err.t new file mode 100644 index 0000000..b3522c0 --- /dev/null +++ b/tests/expr/byteorder/byteorder-no-len_err.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", "0x1", NULL, NULL, NULL); +payload(NULL, "NFT_REG32_15", "1", "12", "4", NULL, NULL, NULL); +byteorder("NFT_REG32_15", "NFT_REG32_15", "0", NULL, "4"); +cmp("NFT_REG32_15", "0", "01020304"); +commit(); diff --git a/tests/expr/byteorder/byteorder-no-op_err.t b/tests/expr/byteorder/byteorder-no-op_err.t new file mode 100644 index 0000000..e2d90c3 --- /dev/null +++ b/tests/expr/byteorder/byteorder-no-op_err.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", NULL, NULL, NULL, NULL); +payload(NULL, "NFT_REG32_15", "1", "12", "4", NULL, NULL, NULL); +byteorder("NFT_REG32_15", "NFT_REG32_15", NULL, "4", "4"); +cmp("NFT_REG32_15", "0", "01020304"); +commit(); diff --git a/tests/expr/byteorder/byteorder-no-size_err.t b/tests/expr/byteorder/byteorder-no-size_err.t new file mode 100644 index 0000000..2df1bdb --- /dev/null +++ b/tests/expr/byteorder/byteorder-no-size_err.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", "0x1", NULL, NULL, NULL); +payload(NULL, "NFT_REG32_15", "1", "12", "4", NULL, NULL, NULL); +byteorder("NFT_REG32_15", "NFT_REG32_15", "0", "4", NULL); +cmp("NFT_REG32_15", "0", "01020304"); +commit(); diff --git a/tests/expr/byteorder/byteorder-no-sreg_err.t b/tests/expr/byteorder/byteorder-no-sreg_err.t new file mode 100644 index 0000000..19eb378 --- /dev/null +++ b/tests/expr/byteorder/byteorder-no-sreg_err.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", "0x1", NULL, NULL, NULL); +payload(NULL, "NFT_REG32_15", "1", "12", "4", NULL, NULL, NULL); +byteorder(NULL, "NFT_REG32_15", "0", "4", "4"); +cmp("NFT_REG32_15", "0", "01020304"); +commit(); diff --git a/tests/expr/byteorder/byteorder-too-large-len_err.t b/tests/expr/byteorder/byteorder-too-large-len_err.t new file mode 100644 index 0000000..ea7d44c --- /dev/null +++ b/tests/expr/byteorder/byteorder-too-large-len_err.t @@ -0,0 +1,7 @@ +add_table(NFPROTO_IPV4, "test", NULL, NULL, NULL); +add_chain("test", "0x1", NULL, NULL, NULL); +add_rule("test", "0x1", NULL, NULL, NULL); +payload(NULL, "NFT_REG32_14", "1", "12", "8", NULL, NULL, NULL); +byteorder("NFT_REG32_00", "NFT_REG32_00", "0", "65", "4"); +cmp("NFT_REG32_00", "0", "0102030401020304"); +commit(); |