Skip to content
This repository was archived by the owner on Feb 5, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/rspec/lib/container_linux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'ssh'

SSH_CMD_CONTAINER_LINUX_VERSION = 'source /usr/share/coreos/release && echo "$COREOS_RELEASE_VERSION"'
SSH_CMD_CONTAINER_LINUX_VERSION = 'sudo cat /var/lib/update_engine/prefs/aleph-version'
SSH_CMD_CONTAINER_LINUX_CHANNEL = 'for conf in /usr/share/coreos/update.conf /etc/coreos/update.conf ; \
do [ -f "$conf" ] && source "$conf" ; done ; echo "$GROUP"'

Expand Down
24 changes: 17 additions & 7 deletions tests/rspec/lib/ssh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,28 @@ def ssh_agent_has_key?
system('ssh-add -l')
end

def ssh_exec(ip_address, command)
def ssh_exec(ip_address, command, max_retries = 5)
retries = 0
status = {}
stdout = ''
stderr = ''
Net::SSH.start(ip_address, 'core', forward_agent: true, use_agent: true) do |ssh|
ssh.exec! command, status: status do |_ch, stream, data|
if stream == :stdout
stdout = data
else
stderr = data
begin
Net::SSH.start(ip_address, 'core', forward_agent: true, use_agent: true) do |ssh|
ssh.exec! command, status: status do |_ch, stream, data|
if stream == :stdout
stdout = data
else
stderr = data
end
end
end
rescue Errno::ECONNREFUSED, Errno::ECONNRESET, IOError, Net::SSH::ConnectionTimeout, Net::SSH::Disconnect
raise "failed to exec '#{command}' in #{max_retries} retries" if retries >= max_retries
retries += 1
sleep_time = 5 * retries
puts "failed to exec '#{command}'; retrying in #{sleep_time} seconds"
sleep sleep_time
retry
end
[stdout, stderr, status[:exit_code]]
end
1 change: 0 additions & 1 deletion tests/smoke/aws/vars/aws.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"tectonic_ca_key": "",
"tectonic_container_linux_channel": "stable",
"tectonic_container_linux_version": "1465.6.0",
"tectonic_bootstrap_upgrade_cl": "false",
"tectonic_etcd_count": "3",
"tectonic_etcd_servers": [""],
"tectonic_master_count": "2",
Expand Down