aboutsummaryrefslogtreecommitdiffstats
path: root/spec/classes/tripleo_profile_base_sshd_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_sshd_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_sshd_spec.rb')
-rw-r--r--spec/classes/tripleo_profile_base_sshd_spec.rb52
1 files changed, 49 insertions, 3 deletions
diff --git a/spec/classes/tripleo_profile_base_sshd_spec.rb b/spec/classes/tripleo_profile_base_sshd_spec.rb
index 58b271f..6333e6b 100644
--- a/spec/classes/tripleo_profile_base_sshd_spec.rb
+++ b/spec/classes/tripleo_profile_base_sshd_spec.rb
@@ -26,7 +26,9 @@ describe 'tripleo::profile::base::sshd' do
it do
is_expected.to contain_class('ssh::server').with({
'storeconfigs_enabled' => false,
- 'options' => {}
+ 'options' => {
+ 'Port' => [22]
+ }
})
is_expected.to_not contain_file('/etc/issue')
is_expected.to_not contain_file('/etc/issue.net')
@@ -39,7 +41,9 @@ describe 'tripleo::profile::base::sshd' do
it do
is_expected.to contain_class('ssh::server').with({
'storeconfigs_enabled' => false,
- 'options' => {}
+ 'options' => {
+ 'Port' => [22]
+ }
})
is_expected.to_not contain_file('/etc/issue')
is_expected.to_not contain_file('/etc/issue.net')
@@ -47,13 +51,50 @@ describe 'tripleo::profile::base::sshd' do
end
end
+ context 'with port configured' do
+ let(:params) {{ :port => 123 }}
+ it do
+ is_expected.to contain_class('ssh::server').with({
+ 'storeconfigs_enabled' => false,
+ 'options' => {
+ 'Port' => [123]
+ }
+ })
+ end
+ end
+
+ context 'with port configured and port option' do
+ let(:params) {{ :port => 123, :options => {'Port' => 456} }}
+ it do
+ is_expected.to contain_class('ssh::server').with({
+ 'storeconfigs_enabled' => false,
+ 'options' => {
+ 'Port' => [456, 123]
+ }
+ })
+ end
+ end
+
+ context 'with port configured and same port option' do
+ let(:params) {{ :port => 123, :options => {'Port' => 123} }}
+ it do
+ is_expected.to contain_class('ssh::server').with({
+ 'storeconfigs_enabled' => false,
+ 'options' => {
+ 'Port' => [123]
+ }
+ })
+ end
+ end
+
context 'with issue and issue.net configured' do
let(:params) {{ :bannertext => 'foo' }}
it do
is_expected.to contain_class('ssh::server').with({
'storeconfigs_enabled' => false,
'options' => {
- 'Banner' => '/etc/issue.net'
+ 'Banner' => '/etc/issue.net',
+ 'Port' => [22]
}
})
is_expected.to contain_file('/etc/issue').with({
@@ -78,6 +119,7 @@ describe 'tripleo::profile::base::sshd' do
is_expected.to contain_class('ssh::server').with({
'storeconfigs_enabled' => false,
'options' => {
+ 'Port' => [22],
'PrintMotd' => 'yes'
}
})
@@ -98,6 +140,7 @@ describe 'tripleo::profile::base::sshd' do
is_expected.to contain_class('ssh::server').with({
'storeconfigs_enabled' => false,
'options' => {
+ 'Port' => [22],
'X11Forwarding' => 'no'
}
})
@@ -117,6 +160,7 @@ describe 'tripleo::profile::base::sshd' do
'storeconfigs_enabled' => false,
'options' => {
'Banner' => '/etc/issue.net',
+ 'Port' => [22],
'PrintMotd' => 'yes'
}
})
@@ -146,6 +190,7 @@ describe 'tripleo::profile::base::sshd' do
:bannertext => 'foo',
:motd => 'foo',
:options => {
+ 'Port' => [22],
'PrintMotd' => 'no', # this should be overridden
'X11Forwarding' => 'no'
}
@@ -155,6 +200,7 @@ describe 'tripleo::profile::base::sshd' do
'storeconfigs_enabled' => false,
'options' => {
'Banner' => '/etc/issue.net',
+ 'Port' => [22],
'PrintMotd' => 'yes',
'X11Forwarding' => 'no'
}