Skip to contentSkip to conversation

tests/py: add test for empty string match

PATCH Applied Harsha Sharma 2 participants 2 messages Nov 28, 2017 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/py: add test for empty string match

This patch add tests for empty string match which fails with error "Empty string is not allowed".

---
 tests/py/any/ct.t   | 1 +
 tests/py/any/meta.t | 2 ++
 2 files changed, 3 insertions(+)
tests/py/any/ct.t +1 -0
index fb3ae09..9c88140 100644
@@ -75,6 +75,7 @@ ct expiration != {33-55};ok; ct expiration != { 33s-55s}
 
 ct helper "ftp";ok
 ct helper "12345678901234567";fail
+ct helper '""';fail
 
 ct state . ct mark { new . 0x12345678};ok
 ct state . ct mark { new . 0x12345678, new . 0x34127856, established . 0x12785634};ok
tests/py/any/meta.t +2 -0
index dd335ab..a38c501 100644
@@ -71,6 +71,7 @@ meta iifname {"dummy0", "lo"};ok
 meta iifname != {"dummy0", "lo"};ok
 meta iifname "dummy*";ok;iifname "dummy*"
 meta iifname "dummy\*";ok;iifname "dummy\*"
+meta iifname '""';fail
 
 meta iiftype {ether, ppp, ipip, ipip6, loopback, sit, ipgre};ok
 meta iiftype != {ether, ppp, ipip, ipip6, loopback, sit, ipgre};ok
@@ -89,6 +90,7 @@ meta oifname != "dummy0";ok;oifname != "dummy0"
 meta oifname { "dummy0", "lo"};ok
 meta oifname "dummy*";ok;oifname "dummy*"
 meta oifname "dummy\*";ok;oifname "dummy\*"
+meta oifname '""';fail
 
 meta oiftype {ether, ppp, ipip, ipip6, loopback, sit, ipgre};ok
 meta oiftype != {ether, ppp, ipip, ipip6, loopback, sit, ipgre};ok
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Harsha Sharma

This patch add tests for empty string match which fails with error "Empty string is not allowed".

Applied, thanks Harsha.