From 304a117c9d5b5d75943692c5feeac9843da2efd2 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Mon, 17 Apr 2017 16:37:41 -0600 Subject: [PATCH] Run migration over ssh spec tests This change moves the ssh migration spec tests into the existing set of shared_examples_for so they actually get run. Change-Id: If9522a4f7dc42d0f1912eae25dfe5529b1233c39 --- spec/classes/nova_migration_libvirt_spec.rb | 84 ++++++++++----------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/spec/classes/nova_migration_libvirt_spec.rb b/spec/classes/nova_migration_libvirt_spec.rb index 8b413ca4f..6f580444f 100644 --- a/spec/classes/nova_migration_libvirt_spec.rb +++ b/spec/classes/nova_migration_libvirt_spec.rb @@ -185,49 +185,6 @@ describe 'nova::migration::libvirt' do end it { is_expected.to contain_file_line('/etc/libvirt/libvirtd.conf listen_address').with(:line => "listen_addr = \"127.0.0.1\"") } end - end - - # TODO (degorenko): switch to on_supported_os function when we got Xenial - context 'on Debian platforms with Ubuntu release 16' do - let :facts do - @default_facts.merge({ - :osfamily => 'Debian', - :operatingsystem => 'Ubuntu', - :operatingsystemmajrelease => '16' - }) - end - - it_configures 'nova migration with libvirt' - it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(:line => 'libvirtd_opts="-l"') } - end - - context 'on Debian platforms release' do - let :facts do - @default_facts.merge({ - :osfamily => 'Debian', - :operatingsystem => 'Debian', - :operatingsystemmajrelease => '8' - }) - end - - it_configures 'nova migration with libvirt' - it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(:line => 'libvirtd_opts="-d -l"') } - end - - context 'on RedHat platforms' do - let :facts do - @default_facts.merge({ - :osfamily => 'RedHat', - :operatingsystem => 'CentOS', - :operatingsystemmajrelease => '7.0' - }) - end - - it_configures 'nova migration with libvirt' - it { is_expected.to contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(:line => 'LIBVIRTD_ARGS="--listen"') } - end - - shared_examples_for 'ssh tunneling' do context 'with ssh transport' do let :params do @@ -277,4 +234,45 @@ describe 'nova::migration::libvirt' do end end + + # TODO (degorenko): switch to on_supported_os function when we got Xenial + context 'on Debian platforms with Ubuntu release 16' do + let :facts do + @default_facts.merge({ + :osfamily => 'Debian', + :operatingsystem => 'Ubuntu', + :operatingsystemmajrelease => '16' + }) + end + + it_configures 'nova migration with libvirt' + it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(:line => 'libvirtd_opts="-l"') } + end + + context 'on Debian platforms release' do + let :facts do + @default_facts.merge({ + :osfamily => 'Debian', + :operatingsystem => 'Debian', + :operatingsystemmajrelease => '8' + }) + end + + it_configures 'nova migration with libvirt' + it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(:line => 'libvirtd_opts="-d -l"') } + end + + context 'on RedHat platforms' do + let :facts do + @default_facts.merge({ + :osfamily => 'RedHat', + :operatingsystem => 'CentOS', + :operatingsystemmajrelease => '7.0' + }) + end + + it_configures 'nova migration with libvirt' + it { is_expected.to contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(:line => 'LIBVIRTD_ARGS="--listen"') } + end + end