X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=spec%2Fspec_helper.rb;h=22c9bb66a708fb4a6ae2ea7f01747c870f256e51;hb=15e3c7500e1a6333601348349c287443928768b8;hp=4df7f21e5da6e5ec8c4f2fc1cc8a54b25a760eb9;hpb=8e38937ca8851a23d1b680732f749084049f7888;p=integration%2Fpackaging%2Fpuppet-opendaylight.git diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4df7f21..22c9bb6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -32,12 +32,36 @@ def supported_os_tests(yum_repo, features) it { should contain_yumrepo('opendaylight').that_comes_before('Package[opendaylight]') } # Confirm properties of other resources - # There's a more elegant way to do these long sets of checks - # using multi-line hashes, but it breaks in Ruby 1.8.7 - it { should contain_yumrepo('opendaylight').with_enabled('1').with_gpgcheck('0').with_descr('OpenDaylight SDN controller').with_baseurl(yum_repo) } - it { should contain_package('opendaylight').with_ensure('present') } - it { should contain_service('opendaylight').with_ensure('running').with_enable('true').with_hasstatus('true').with_hasrestart('true') } - it { should contain_file('org.apache.karaf.features.cfg').with_ensure('file').with_path('/opt/opendaylight-0.2.2/etc/org.apache.karaf.features.cfg').with_content(/^featuresBoot=#{features.join(",")}/) } + # NB: These hashes don't work with Ruby 1.8.7, but we + # don't support 1.8.7 so that's okay. See issue #36. + it { + should contain_yumrepo('opendaylight').with( + 'enabled' => '1', + 'gpgcheck' => '0', + 'descr' => 'OpenDaylight SDN controller', + 'baseurl' => yum_repo, + ) + } + it { + should contain_package('opendaylight').with( + 'ensure' => 'present', + ) + } + it { + should contain_service('opendaylight').with( + 'ensure' => 'running', + 'enable' => 'true', + 'hasstatus' => 'true', + 'hasrestart' => 'true', + ) + } + it { + should contain_file('org.apache.karaf.features.cfg').with( + 'ensure' => 'file', + 'path' => '/opt/opendaylight-0.2.2/etc/org.apache.karaf.features.cfg', + 'content' => /^featuresBoot=#{features.join(",")}/ + ) + } end # Shared tests for unsupported OSs