Commit f019461f authored by Tails developers's avatar Tails developers
Browse files

Add step to check if any packets have gone to the internet under the clearnet user's account.

parent 3b20af7a
......@@ -212,3 +212,24 @@ But /^checking for updates is disabled in the Unsafe Browser's configuration$/ d
prefs = '/usr/share/tails/unsafe-browser/prefs.js'
assert(@vm.file_content(prefs).include?('pref("app.update.enabled", false)'))
Then /^the clearnet user has (|not )sent packets out to the Internet$/ do |sent|
next if @skip_steps_while_restoring_background
pkts = 0
uid = @vm.execute_successfully("id -u clearnet").stdout.chomp.to_i
iptables_output = @vm.execute_successfully("iptables -vnL").stdout.chomp
output_chain = iptables_parse(iptables_output)["OUTPUT"]
output_chain["rules"].each do |rule|
m = /owner UID match \b#{uid}\b/.match(rule["extra"])
if !m.nil?
pkts = pkts + rule["pkts"]
case sent
when ''
assert(pkts > 0, "Packets have not gone out to the internet.")
when 'not'
assert_equal(pkts, 0, "Packets have gone out to the internet.")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment