diff options
author | Aaron Kemp <kemp@google.com> | 2015-03-02 15:05:44 -0500 |
---|---|---|
committer | Gilad Arnold <garnold@google.com> | 2015-08-10 23:11:52 -0700 |
commit | 1bddb2cfdda68f99d27495a9f6b9f720db2a7144 (patch) | |
tree | 90e30706444db84f5dc03ada00b04a0a7aed180b /iptables_unittest.cc | |
parent | 650d229bfc31be30636c2ac62f242952e4f583d4 (diff) | |
download | firewalld-1bddb2cfdda68f99d27495a9f6b9f720db2a7144.tar.gz |
firewalld: allow interface names containing '-'
Previously, interface names could only contain alphanumerics.
BUG=none
TEST=ran iptables unit tests
Change-Id: I19951389f7fef54f74568592f6988fd5da1b164b
Reviewed-on: https://chromium-review.googlesource.com/255152
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Aaron Kemp <kemp@google.com>
Commit-Queue: Aaron Kemp <kemp@google.com>
Diffstat (limited to 'iptables_unittest.cc')
-rw-r--r-- | iptables_unittest.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/iptables_unittest.cc b/iptables_unittest.cc index e70fcb0..65503a1 100644 --- a/iptables_unittest.cc +++ b/iptables_unittest.cc @@ -40,6 +40,12 @@ TEST_F(IpTablesTest, InvalidInterfaceName) { ASSERT_FALSE(iptables_succeeds.PunchUdpHole(53, "reallylonginterfacename")); ASSERT_FALSE(iptables_succeeds.PunchUdpHole(53, "with spaces")); ASSERT_FALSE(iptables_succeeds.PunchUdpHole(53, "with$ymbols")); + ASSERT_FALSE(iptables_succeeds.PunchUdpHole(53, "-startdash")); + ASSERT_FALSE(iptables_succeeds.PunchUdpHole(53, "enddash-")); +} + +TEST_F(IpTablesTest, ValidInterfaceName) { + ASSERT_TRUE(iptables_succeeds.PunchUdpHole(53, "middle-dash")); } TEST_F(IpTablesTest, PunchTcpHoleSucceeds) { |