summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2015-09-13 15:39:28 +0200
committeranonym <anonym@riseup.net>2016-02-10 13:54:25 +0100
commit163b76c54d0654f2e30f95034b6952c9d71935cf (patch)
tree78f75aa596513cacf5dbf0c6c6fe6fca68a85d91
parent0f79c3dc122543fa27d35be265506d5b1ecadcb6 (diff)
Test that Tor Launcher uses the correct TBB libs.
-rw-r--r--features/step_definitions/browser.rb17
-rw-r--r--features/tor_bridges.feature1
2 files changed, 14 insertions, 4 deletions
diff --git a/features/step_definitions/browser.rb b/features/step_definitions/browser.rb
index 24f604d..84ef1d3 100644
--- a/features/step_definitions/browser.rb
+++ b/features/step_definitions/browser.rb
@@ -35,6 +35,7 @@ def xul_application_info(application)
'echo ${TBB_INSTALL}/firefox', :libs => 'tor-browser'
).stdout.chomp
address_bar_image = "BrowserAddressBar.png"
+ unused_tbb_libs = ['libnssdbm3.so']
case application
when "Tor Browser"
user = LIVE_USER
@@ -53,10 +54,18 @@ def xul_application_info(application)
new_tab_button_image = "I2PBrowserNewTabButton.png"
when "Tor Launcher"
user = "tor-launcher"
- cmd_regex = "#{binary}\s+-app /usr/local/lib/tor-launcher-standalone/application\.ini"
+ # We do not enable AppArmor confinement for the Tor Launcher.
+ binary = "#{binary}-unconfined"
+ tor_launcher_install = $vm.execute_successfully(
+ 'echo ${TOR_LAUNCHER_INSTALL}', :libs => 'tor-browser'
+ ).stdout.chomp
+ cmd_regex = "#{binary}\s+-app #{tor_launcher_install}/application\.ini.*"
chroot = ""
new_tab_button_image = nil
address_bar_image = nil
+ # The standalone Tor Launcher uses fewer libs than the full
+ # browser.
+ unused_tbb_libs.concat(["libfreebl3.so", "libnssckbi.so", "libsoftokn3.so"])
else
raise "Invalid browser or XUL application: #{application}"
end
@@ -66,6 +75,7 @@ def xul_application_info(application)
:chroot => chroot,
:new_tab_button_image => new_tab_button_image,
:address_bar_image => address_bar_image,
+ :unused_tbb_libs => unused_tbb_libs,
}
end
@@ -108,8 +118,7 @@ Then /^the (.*) has no plugins installed$/ do |browser|
step "I see \"TorBrowserNoPlugins.png\" after at most 30 seconds"
end
-def xul_app_shared_lib_check(pid, chroot)
- expected_absent_tbb_libs = ['libnssdbm3.so']
+def xul_app_shared_lib_check(pid, chroot, expected_absent_tbb_libs = [])
absent_tbb_libs = []
unwanted_native_libs = []
tbb_libs = $vm.execute_successfully("ls -1 #{chroot}${TBB_INSTALL}/*.so",
@@ -141,7 +150,7 @@ Then /^the (.*) uses all expected TBB shared libraries$/ do |application|
info = xul_application_info(application)
pid = $vm.execute_successfully("pgrep --uid #{info[:user]} --full --exact '#{info[:cmd_regex]}'").stdout.chomp
assert(/\A\d+\z/.match(pid), "It seems like #{application} is not running")
- xul_app_shared_lib_check(pid, info[:chroot])
+ xul_app_shared_lib_check(pid, info[:chroot], info[:unused_tbb_libs])
end
Then /^the (.*) chroot is torn down$/ do |browser|
diff --git a/features/tor_bridges.feature b/features/tor_bridges.feature
index cab4e39..b5277ca 100644
--- a/features/tor_bridges.feature
+++ b/features/tor_bridges.feature
@@ -9,6 +9,7 @@ Feature: Using Tails with Tor pluggable transports
And I capture all network traffic
When the network is plugged
Then the Tor Launcher autostarts
+ And the Tor Launcher uses all expected TBB shared libraries
Scenario: Using bridges
When I configure some Bridge pluggable transports in Tor Launcher