Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tails
tails
Commits
2f66e859
Commit
2f66e859
authored
Nov 24, 2015
by
intrigeri
Browse files
Test suite: escape regexp special characters when constructing the firewall log parsing regexp.
.. and pass -P to grep, since Ruby uses PCRE.
parent
91300962
Changes
1
Hide whitespace changes
Inline
Side-by-side
features/step_definitions/tor.rb
View file @
2f66e859
...
@@ -160,9 +160,11 @@ Then /^the firewall is configured to block all IPv6 traffic$/ do
...
@@ -160,9 +160,11 @@ Then /^the firewall is configured to block all IPv6 traffic$/ do
end
end
def
firewall_has_dropped_packet_to?
(
proto
,
host
,
port
)
def
firewall_has_dropped_packet_to?
(
proto
,
host
,
port
)
regex
=
"^Dropped outbound packet: .* DST=
#{
host
}
.* PROTO=
#{
proto
}
"
regex
=
"^Dropped outbound packet: .* "
regex
+=
"DST=
#{
Regexp
.
escape
(
host
)
}
.* "
regex
+=
"PROTO=
#{
Regexp
.
escape
(
proto
)
}
"
regex
+=
".* DPT=
#{
port
}
"
if
port
regex
+=
".* DPT=
#{
port
}
"
if
port
$vm
.
execute
(
"journalctl --dmesg --output=cat | grep -q '
#{
regex
}
'"
).
success?
$vm
.
execute
(
"journalctl --dmesg --output=cat | grep -q
P
'
#{
regex
}
'"
).
success?
end
end
When
/^I open an untorified (TCP|UDP|ICMP) connections to (\S*)(?: on port (\d+))? that is expected to fail$/
do
|
proto
,
host
,
port
|
When
/^I open an untorified (TCP|UDP|ICMP) connections to (\S*)(?: on port (\d+))? that is expected to fail$/
do
|
proto
,
host
,
port
|
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment