diff --git a/acceptance/tests/resource/service/smf_basic_tests.rb b/acceptance/tests/resource/service/smf_basic_tests.rb index 5f222adcb..0eda50c04 100644 --- a/acceptance/tests/resource/service/smf_basic_tests.rb +++ b/acceptance/tests/resource/service/smf_basic_tests.rb @@ -1,40 +1,40 @@ test_name "SMF: basic tests" confine :to, :platform => 'solaris' require 'puppet/acceptance/solaris_util' extend Puppet::Acceptance::SMFUtils teardown do step "SMF: cleanup" agents.each do |agent| clean agent, :service => 'tstapp' end end agents.each do |agent| clean agent, :service => 'tstapp' manifest, method = setup agent, :service => 'tstapp' step "SMF: clean slate" apply_manifest_on(agent, 'service {tstapp : ensure=>stopped}') do assert_match( /.*/, result.stdout, "err: #{agent}") end - step "SMF: ensre it is created with a manifest" + step "SMF: ensure it is created with a manifest" apply_manifest_on(agent, 'service {tstapp : ensure=>running, manifest=>"%s"}' % manifest) do - assert_match( / ensure changed 'stopped' to 'running'/, result.stdout, "err: #{agent}") + assert_match( / ensure changed 'stopped'.* to 'running'/, result.stdout, "err: #{agent}") end step "SMF: verify it with puppet" on agent, "puppet resource service tstapp" do assert_match( /ensure => 'running'/, result.stdout, "err: #{agent}") end step "SMF: verify with svcs that the service is online" on agent, "svcs -l application/tstapp" do assert_match( /state\s+online/, result.stdout, "err: #{agent}") end step "SMF: stop the service" apply_manifest_on(agent, 'service {tstapp : ensure=>stopped}') do - assert_match( /changed 'running' to 'stopped'/, result.stdout, "err: #{agent}") + assert_match( /changed 'running'.* to 'stopped'/, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/service/smf_should_be_idempotent.rb b/acceptance/tests/resource/service/smf_should_be_idempotent.rb index d2f9b2de8..c86ec248f 100644 --- a/acceptance/tests/resource/service/smf_should_be_idempotent.rb +++ b/acceptance/tests/resource/service/smf_should_be_idempotent.rb @@ -1,33 +1,33 @@ test_name "SMF: should be idempotent" confine :to, :platform => 'solaris' require 'puppet/acceptance/solaris_util' extend Puppet::Acceptance::SMFUtils teardown do step "SMF: cleanup" agents.each do |agent| clean agent, :service => 'tstapp' end end agents.each do |agent| clean agent, :service => 'tstapp' manifest, method = setup agent, :service => 'tstapp' step "SMF: ensre it is created with a manifest" apply_manifest_on(agent, 'service {tstapp : ensure=>running, manifest=>"%s"}' % manifest) do - assert_match( / ensure changed 'stopped' to 'running'/, result.stdout, "err: #{agent}") + assert_match( / ensure changed 'stopped'.* to 'running'/, result.stdout, "err: #{agent}") end step "SMF: verify with svcs that the service is online" on agent, "svcs -l application/tstapp" do assert_match( /state\s+online/, result.stdout, "err: #{agent}") end step "SMF: ensre it is not created again" apply_manifest_on(agent, 'service {tstapp : ensure=>running, manifest=>"%s"}' % manifest) do assert_no_match( /changed/, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/service/smf_should_create.rb b/acceptance/tests/resource/service/smf_should_create.rb index af8e10d9a..33cdeba64 100644 --- a/acceptance/tests/resource/service/smf_should_create.rb +++ b/acceptance/tests/resource/service/smf_should_create.rb @@ -1,26 +1,26 @@ test_name "SMF: should create a service given a manifest" confine :to, :platform => 'solaris' require 'puppet/acceptance/solaris_util' extend Puppet::Acceptance::SMFUtils teardown do step "SMF: cleanup" agents.each do |agent| clean agent, :service => 'tstapp' end end agents.each do |agent| manifest, method = setup agent, :service => 'tstapp' step "SMF: ensure it is created with a manifest" apply_manifest_on(agent, 'service {tstapp : ensure=>running, manifest=>"%s"}' % manifest) do - assert_match( / ensure changed 'stopped' to 'running'/, result.stdout, "err: #{agent}") + assert_match( / ensure changed 'stopped'.* to 'running'/, result.stdout, "err: #{agent}") end step "SMF: verify with svcs that the service is online" on agent, "svcs -l application/tstapp" do assert_match( /state\s+online/, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/service/smf_should_query.rb b/acceptance/tests/resource/service/smf_should_query.rb index ca231c112..3da796ac9 100644 --- a/acceptance/tests/resource/service/smf_should_query.rb +++ b/acceptance/tests/resource/service/smf_should_query.rb @@ -1,29 +1,29 @@ test_name "SMF: should query instances" confine :to, :platform => 'solaris' require 'puppet/acceptance/solaris_util' extend Puppet::Acceptance::SMFUtils teardown do step "SMF: cleanup" agents.each do |agent| clean agent, :service => 'tstapp' end end agents.each do |agent| manifest, method = setup agent, :service => 'tstapp' step "SMF: ensre it is created with a manifest" apply_manifest_on(agent, 'service {tstapp : ensure=>running, manifest=>"%s"}' % manifest) do - assert_match( / ensure changed 'stopped' to 'running'/, result.stdout, "err: #{agent}") + assert_match( / ensure changed 'stopped'.* to 'running'/, result.stdout, "err: #{agent}") end step "SMF: query the resource" on agent, "puppet resource service tstapp" do assert_match( /ensure => 'running'/, result.stdout, "err: #{agent}") end step "SMF: query all the instances" on agent, "puppet resource service" do assert_match( /tstapp/, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/service/smf_should_stop.rb b/acceptance/tests/resource/service/smf_should_stop.rb index d74f51834..9f4ee0cfc 100644 --- a/acceptance/tests/resource/service/smf_should_stop.rb +++ b/acceptance/tests/resource/service/smf_should_stop.rb @@ -1,31 +1,31 @@ test_name "SMF: should stop a given service" confine :to, :platform => 'solaris' require 'puppet/acceptance/solaris_util' extend Puppet::Acceptance::SMFUtils teardown do step "SMF: cleanup" agents.each do |agent| clean agent, :service => 'tstapp' end end agents.each do |agent| manifest, method = setup agent, :service => 'tstapp' step "SMF: ensre it is created with a manifest" apply_manifest_on(agent, 'service {tstapp : ensure=>running, manifest=>"%s"}' % manifest) do - assert_match( / ensure changed 'stopped' to 'running'/, result.stdout, "err: #{agent}") + assert_match( / ensure changed 'stopped'.* to 'running'/, result.stdout, "err: #{agent}") end step "SMF: stop the service" apply_manifest_on(agent, 'service {tstapp : ensure=>stopped}') do - assert_match( /changed 'running' to 'stopped'/, result.stdout, "err: #{agent}") + assert_match( /changed 'running'.* to 'stopped'/, result.stdout, "err: #{agent}") end step "SMF: verify with svcs that the service is not online" on agent, "svcs -l application/tstapp", :acceptable_exit_codes => [0,1] do assert_no_match( /state\s+online/, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/zfs/basic_tests.rb b/acceptance/tests/resource/zfs/basic_tests.rb index e5f6413ed..a91d0a486 100644 --- a/acceptance/tests/resource/zfs/basic_tests.rb +++ b/acceptance/tests/resource/zfs/basic_tests.rb @@ -1,53 +1,53 @@ test_name "ZFS: configuration" confine :to, :platform => 'solaris' require 'puppet/acceptance/solaris_util' extend Puppet::Acceptance::ZFSUtils teardown do step "ZFS: cleanup" agents.each do |agent| clean agent end end agents.each do |agent| step "ZFS: cleanup" clean agent step "ZFS: setup" setup agent step "ZFS: ensure clean slate" apply_manifest_on(agent, 'zfs { "tstpool/tstfs": ensure=>absent}') do assert_match( /Finished catalog run in .*/, result.stdout, "err: #{agent}") end step "ZFS: basic - ensure it is created" apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do assert_match( /ensure: created/, result.stdout, "err: #{agent}") end step "ZFS: idempotence - create" apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do assert_no_match( /ensure: created/, result.stdout, "err: #{agent}") end step "ZFS: cleanup for next test" apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>absent}') do assert_match( /ensure: removed/, result.stdout, "err: #{agent}") end step "ZFS: create with a mount point" apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt"}') do assert_match( /ensure: created/, result.stdout, "err: #{agent}") end step "ZFS: change mount point and verify" apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt2"}') do - assert_match( /mountpoint changed '.ztstpool.mnt' to '.ztstpool.mnt2'/, result.stdout, "err: #{agent}") + assert_match( /mountpoint changed '.ztstpool.mnt'.* to '.ztstpool.mnt2'/, result.stdout, "err: #{agent}") end step "ZFS: ensure can be removed." apply_manifest_on(agent, 'zfs { "tstpool/tstfs": ensure=>absent}') do assert_match( /ensure: removed/, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/zfs/should_be_idempotent.rb b/acceptance/tests/resource/zfs/should_be_idempotent.rb index b7797d637..b56f742d2 100644 --- a/acceptance/tests/resource/zfs/should_be_idempotent.rb +++ b/acceptance/tests/resource/zfs/should_be_idempotent.rb @@ -1,37 +1,37 @@ test_name "ZFS: configuration" confine :to, :platform => 'solaris' require 'puppet/acceptance/solaris_util' extend Puppet::Acceptance::ZFSUtils teardown do step "ZFS: cleanup" agents.each do |agent| clean agent end end agents.each do |agent| step "ZFS: setup" setup agent step "ZFS: create with a mount point" apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt"}') do assert_match( /ensure: created/, result.stdout, "err: #{agent}") end step "ZFS: idempotence - create" apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do assert_no_match( /ensure: created/, result.stdout, "err: #{agent}") end step "ZFS: change mount point and verify" apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt2"}') do - assert_match( /mountpoint changed '.ztstpool.mnt' to '.ztstpool.mnt2'/, result.stdout, "err: #{agent}") + assert_match( /mountpoint changed '.ztstpool.mnt'.* to '.ztstpool.mnt2'/, result.stdout, "err: #{agent}") end step "ZFS: change mount point and verify idempotence" apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt2"}') do assert_no_match( /changed/, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/zone/dataset.rb b/acceptance/tests/resource/zone/dataset.rb index 53479424b..e775f2ef9 100755 --- a/acceptance/tests/resource/zone/dataset.rb +++ b/acceptance/tests/resource/zone/dataset.rb @@ -1,68 +1,68 @@ test_name "Zone: dataset configuration" confine :to, :platform => 'solaris' require 'puppet/acceptance/solaris_util' extend Puppet::Acceptance::ZoneUtils def moresetup(agent) # This should fail if /tstzones already exists. on agent,"mkdir /tstzones" on agent,"mkfile 64m /tstzones/dsk" on agent,"zpool create tstpool /tstzones/dsk" on agent,"zfs create tstpool/xx" on agent,"zfs create tstpool/yy" on agent,"zfs create tstpool/zz" end def moreclean(agent) on agent, "zfs destroy -r tstpool" on agent, "zpool destroy tstpool" on agent, "rm -f /tstzones/dsk" end teardown do step "Zone: dataset - cleanup" agents.each do |agent| clean agent moreclean agent end end agents.each do |agent| step "Zone: dataset - setup" setup agent moresetup agent #----------------------------------- step "Zone: dataset - make it configured" # Make it configured apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, path=>"/tstzones/mnt" }') do assert_match( /ensure: created/, result.stdout, "err: #{agent}") end step "Zone: dataset - basic test, a single data set" apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>"tstpool/xx", path=>"/tstzones/mnt" }') do assert_match(/defined 'dataset' as .'tstpool.xx'./, result.stdout, "err: #{agent}") end step "Zone: dataset - basic test, a single data set should change to another" apply_manifest_on(agent,'zone {tstzone : ensure=>configured, dataset=>"tstpool/yy", path=>"/tstzones/mnt" }') do - assert_match(/dataset changed 'tstpool.xx' to .'tstpool.yy'./, result.stdout, "err: #{agent}") + assert_match(/dataset changed 'tstpool.xx'.* to .'tstpool.yy'./, result.stdout, "err: #{agent}") end step "Zone: dataset - basic test, idempotency" apply_manifest_on(agent,'zone {tstzone : ensure=>configured, dataset=>"tstpool/yy", path=>"/tstzones/mnt" }') do - assert_no_match(/dataset changed 'tstpool.xx' to .'tstpool.yy'./, result.stdout, "err: #{agent}") + assert_no_match(/dataset changed 'tstpool.xx'.* to .'tstpool.yy'./, result.stdout, "err: #{agent}") end step "Zone: dataset - array test, should change to an array" apply_manifest_on(agent,'zone {tstzone : ensure=>configured, dataset=>["tstpool/yy","tstpool/zz"], path=>"/tstzones/mnt" }') do - assert_match(/dataset changed 'tstpool.yy' to .'tstpool.yy', 'tstpool.zz'./, result.stdout, "err: #{agent}") + assert_match(/dataset changed 'tstpool.yy'.* to .'tstpool.yy', 'tstpool.zz'./, result.stdout, "err: #{agent}") end step "Zone: dataset - array test, should change one single element" apply_manifest_on(agent,'zone {tstzone : ensure=>configured, dataset=>["tstpool/xx","tstpool/zz"], path=>"/tstzones/mnt" }') do - assert_match(/dataset changed 'tstpool.yy,tstpool.zz' to .'tstpool.xx', 'tstpool.zz'./, result.stdout, "err: #{agent}") + assert_match(/dataset changed 'tstpool.yy,tstpool.zz'.* to .'tstpool.xx', 'tstpool.zz'./, result.stdout, "err: #{agent}") end step "Zone: dataset - array test, should remove elements" apply_manifest_on(agent,'zone {tstzone : ensure=>configured, dataset=>[], path=>"/tstzones/mnt" }') do - assert_match(/dataset changed 'tstpool.zz,tstpool.xx' to ../, result.stdout, "err: #{agent}") + assert_match(/dataset changed 'tstpool.zz,tstpool.xx'.* to ../, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/zone/set_ip.rb b/acceptance/tests/resource/zone/set_ip.rb index aa9f6e237..aad2463ef 100755 --- a/acceptance/tests/resource/zone/set_ip.rb +++ b/acceptance/tests/resource/zone/set_ip.rb @@ -1,64 +1,64 @@ test_name "Zone:IP ip-type and ip configuration" confine :to, :platform => 'solaris' require 'puppet/acceptance/solaris_util' extend Puppet::Acceptance::ZoneUtils teardown do step "Zone: ip - cleanup" agents.each do |agent| clean agent end end agents.each do |agent| step "Zone: ip - setup" setup agent # See # https://hg.openindiana.org/upstream/illumos/illumos-gate/file/03d5725cda56/usr/src/lib/libinetutil/common/ifspec.c # for the funciton ifparse_ifspec. This is the only documentation that exists # as to what the zone interface can be. #----------------------------------- # Make sure that the zone is absent. step "Zone: ip - make it configured" apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt" }') do assert_match( /ensure: created/, result.stdout, "err: #{agent}") end step "Zone: ip - ip switch: verify that the change from shared to exclusive works." # -------------------------------------------------------------------- apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>exclusive, path=>"/tstzones/mnt" }') do - assert_match(/iptype changed 'shared' to 'exclusive'/, result.stdout, "err: #{agent}") + assert_match(/iptype changed 'shared'.* to 'exclusive'/, result.stdout, "err: #{agent}") end step "Zone: ip - ip switch: verify that we can change it back" # -------------------------------------------------------------------- apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>exclusive, path=>"/tstzones/mnt" }') do - assert_no_match(/iptype changed 'shared' to 'exclusive'/, result.stdout, "err: #{agent}") + assert_no_match(/iptype changed 'shared'.* to 'exclusive'/, result.stdout, "err: #{agent}") end step "Zone: ip - switch to shared for remaining cases" # we have to use shared for remaining test cases. apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt" }') do - assert_match(/iptype changed 'exclusive' to 'shared'/, result.stdout, "err: #{agent}") + assert_match(/iptype changed 'exclusive'.* to 'shared'/, result.stdout, "err: #{agent}") end step "Zone: ip - assign: ensure that our ip assignment works." # -------------------------------------------------------------------- apply_manifest_on(agent,'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt", ip=>"ip.if.1" }', :acceptable_exit_codes => [1] ) do assert_match(/ip must contain interface name and ip address separated by a \W*?:/, result.output, "err: #{agent}") end apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt", ip=>"ip.if.1:1.1.1.1" }') do assert_match(/defined 'ip' as .'ip.if.1:1.1.1.1'./ , result.stdout, "err: #{agent}") end step "Zone: ip - assign: arrays should be created" # -------------------------------------------------------------------- apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt", ip=>["ip.if.1:1.1.1.1", "ip.if.2:1.1.1.2"] }') do - assert_match( /ip changed 'ip.if.1:1.1.1.1' to .'ip.if.1:1.1.1.1', 'ip.if.2:1.1.1.2'./, result.stdout, "err: #{agent}") + assert_match( /ip changed 'ip.if.1:1.1.1.1'.* to .'ip.if.1:1.1.1.1', 'ip.if.2:1.1.1.2'./, result.stdout, "err: #{agent}") end step "Zone: ip - assign: arrays should be modified" apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt", ip=>["ip.if.1:1.1.1.1", "ip.if.2:1.1.1.3"] }') do - assert_match(/ip changed 'ip.if.1:1.1.1.1,ip.if.2:1.1.1.2' to .'ip.if.1:1.1.1.1', 'ip.if.2:1.1.1.3'./, result.stdout, "err: #{agent}") + assert_match(/ip changed 'ip.if.1:1.1.1.1,ip.if.2:1.1.1.2'.* to .'ip.if.1:1.1.1.1', 'ip.if.2:1.1.1.3'./, result.stdout, "err: #{agent}") end step "Zone: ip - idempotency: arrays" apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt", ip=>["ip.if.1:1.1.1.1", "ip.if.2:1.1.1.3"] }') do assert_no_match(/ip changed/, result.stdout, "err: #{agent}") end end diff --git a/acceptance/tests/resource/zone/set_path.rb b/acceptance/tests/resource/zone/set_path.rb index e92f51060..7a172421f 100644 --- a/acceptance/tests/resource/zone/set_path.rb +++ b/acceptance/tests/resource/zone/set_path.rb @@ -1,49 +1,49 @@ test_name "Zone:Path configuration" confine :to, :platform => 'solaris' require 'puppet/acceptance/solaris_util' extend Puppet::Acceptance::ZoneUtils teardown do step "Zone: path - cleanup" agents.each do |agent| clean agent end end agents.each do |agent| step "Zone: path - setup" setup agent #----------------------------------- step "Zone: path - required parameter (-)" apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared }') do assert_match( /Error: Path is required/, result.output, "err: #{agent}") end step "Zone: path - required parameter (+)" apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt" }') do assert_match( /ensure: created/, result.stdout, "err: #{agent}") end step "Zone: path - should change the path if it is switched before install" apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt2" }') do - assert_match(/path changed '.tstzones.mnt' to '.tstzones.mnt2'/, result.stdout, "err: #{agent}") + assert_match(/path changed '.tstzones.mnt'.* to '.tstzones.mnt2'/, result.stdout, "err: #{agent}") end step "Zone: path - verify the path is correct" on agent,"/usr/sbin/zonecfg -z tstzone export" do assert_match(/set zonepath=.*mnt2/, result.stdout, "err: #{agent}") end step "Zone: path - revert to original path" apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, iptype=>shared, path=>"/tstzones/mnt" }') do - assert_match(/path changed '.tstzones.mnt2' to '.tstzones.mnt'/, result.stdout, "err: #{agent}") + assert_match(/path changed '.tstzones.mnt2'.* to '.tstzones.mnt'/, result.stdout, "err: #{agent}") end step "Zone: path - verify that we have correct path" on agent,"/usr/sbin/zonecfg -z tstzone export" do assert_match(/set zonepath=.tstzones.mnt/, result.stdout, "err: #{agent}") end end