aboutsummaryrefslogtreecommitdiffstats
path: root/spec/classes/tripleo_profile_base_nova_migration_target_spec.rb
diff options
context:
space:
mode:
authorOliver Walsh <owalsh@redhat.com>2017-09-06 11:19:48 +0100
committerOliver Walsh <owalsh@redhat.com>2017-09-20 11:51:17 +0100
commit68c6f280b1ca77f9c01dac257e0a603f51809eb7 (patch)
treef802f15fb4404441b90e9c5002d4222971c416dd /spec/classes/tripleo_profile_base_nova_migration_target_spec.rb
parent4a16f486e0207e47883cbc4c89293d786b9aa230 (diff)
Support for Ocata-Pike live-migration over ssh
In Ocata all live-migration over ssh is performed on the default ssh port (22). In Pike the containerized live-migration over ssh is on port 2022 as the docker host's sshd is using port 22. To allow live migration during upgrade we need to temporarily pin the Pike computes to port 22 and in the final converge we can switch over to port 2022. This patch make the necessary puppet-tripleo change to allow this: - Adds support in sshd profile for listening on multiple ports. - Adds a profile to allow proxying to the containerized sshd from the baremetal sshd Change-Id: I0b80b81711f683be539939e7d084365ff63546d3 Related-bug: 1714171 (cherry picked from commit 05a413c34fa1266d38bf991a1f5ed2795631f0b7)
Diffstat (limited to 'spec/classes/tripleo_profile_base_nova_migration_target_spec.rb')
-rw-r--r--spec/classes/tripleo_profile_base_nova_migration_target_spec.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/spec/classes/tripleo_profile_base_nova_migration_target_spec.rb b/spec/classes/tripleo_profile_base_nova_migration_target_spec.rb
index a14b89a..4c872b7 100644
--- a/spec/classes/tripleo_profile_base_nova_migration_target_spec.rb
+++ b/spec/classes/tripleo_profile_base_nova_migration_target_spec.rb
@@ -269,6 +269,51 @@ eos
it { is_expected.to_not compile }
end
+ context 'with step 4 with wrapper_command' do
+ let(:pre_condition) {
+ <<-eos
+ class { '::tripleo::profile::base::nova::migration':
+ step => #{params[:step]}
+ }
+ class { '::ssh::server':
+ storeconfigs_enabled => false,
+ options => {}
+ }
+eos
+ }
+ let(:params) { {
+ :step => 4,
+ :ssh_authorized_keys => ['ssh-rsa bar', 'ssh-rsa baz'],
+ :services_enabled => ['docker', 'nova_migration_target'],
+ :wrapper_command => '/bin/true'
+ } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::migration')
+ is_expected.to contain_ssh__server__match_block('nova_migration allow').with(
+ :type => 'User',
+ :name => 'nova_migration',
+ :options => {
+ 'ForceCommand' => '/bin/true',
+ 'PasswordAuthentication' => 'no',
+ 'AllowTcpForwarding' => 'no',
+ 'X11Forwarding' => 'no',
+ 'AuthorizedKeysFile' => '/etc/nova/migration/authorized_keys'
+ }
+ )
+ is_expected.to_not contain_ssh__server__match_block('nova_migration deny')
+ is_expected.to contain_file('/etc/nova/migration/authorized_keys').with(
+ :content => 'ssh-rsa bar\nssh-rsa baz',
+ :mode => '0640',
+ :owner => 'root',
+ :group => 'nova_migration',
+ )
+ is_expected.to contain_user('nova_migration').with(
+ :shell => '/bin/bash'
+ )
+ }
+ end
+
end