summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2016-08-25 19:10:05 +0000
committerintrigeri <intrigeri@boum.org>2016-08-25 19:14:51 +0000
commita870e472441281b7db95713edac5f0d77520936b (patch)
tree130a753b7a988b8b6230a344638f6b4669a789cb
parente642fc6376425ff842ced1881ae5db7c2c99f4b1 (diff)
Test suite: simplify adding NetworkManager connections, and rely more on the defaults.
Not providing the complete configuration file makes us test something closer to what happens when a user adds a Wi-Fi connection themselves.
-rw-r--r--features/step_definitions/common_steps.rb26
1 files changed, 4 insertions, 22 deletions
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb
index af4445f..37223b4 100644
--- a/features/step_definitions/common_steps.rb
+++ b/features/step_definitions/common_steps.rb
@@ -562,28 +562,10 @@ When /^I start the Tor Browser in offline mode$/ do
end
Given /^I add a wired DHCP NetworkManager connection called "([^"]+)"$/ do |con_name|
- con_content = <<EOF
-[802-3-ethernet]
-duplex=full
-
-[connection]
-id=#{con_name}
-uuid=bbc60668-1be0-11e4-a9c6-2f1ce0e75bf1
-type=802-3-ethernet
-timestamp=1395406011
-
-[ipv6]
-method=auto
-
-[ipv4]
-method=auto
-EOF
- con_content.split("\n").each do |line|
- $vm.execute("echo '#{line}' >> /tmp/NM.#{con_name}")
- end
- con_file = "/etc/NetworkManager/system-connections/#{con_name}"
- $vm.execute("install -m 0600 '/tmp/NM.#{con_name}' '#{con_file}'")
- $vm.execute_successfully("nmcli connection load '#{con_file}'")
+ $vm.execute_successfully(
+ "nmcli connection add con-name #{con_name} " + \
+ "type ethernet autoconnect yes ifname eth0"
+ )
try_for(10) {
nm_con_list = $vm.execute("nmcli --terse --fields NAME connection show").stdout
nm_con_list.split("\n").include? "#{con_name}"