@@ -44,10 +44,20 @@ def target_platform
4444 '6.15.0'
4545 when %r{osx-11}
4646 '6.23.0'
47+ when %r{osx-12}
48+ '6.27.1'
4749 else
4850 '6.17.0'
4951 end
5052
53+ # we can only tests puppet 6.x -> 6.y upgrades if there multiple versions
54+ multiple_puppet6_versions = case target_platform
55+ when %r{osx-12}
56+ false
57+ else
58+ true
59+ end
60+
5161 # extra request is needed on windows hosts
5262 # this will fail with "execution expired"
5363 run_task ( 'puppet_agent::version' , 'target' , { } ) if %r{win} . match? ( target_platform )
@@ -98,17 +108,22 @@ def target_platform
98108 expect ( res [ 'value' ] [ 'source' ] ) . to be
99109 end
100110
101- # Upgrade to latest puppet6 version
102- results = run_task ( 'puppet_agent::install' , 'target' , { 'collection' => 'puppet6' , 'version' => ' latest' } )
103- expect ( results ) . to all ( include ( 'status' => 'success' ) )
111+ # An OS needs to be supported for more than one 6.x release to test the
112+ # upgrade from puppet_6_version to latest
113+ if multiple_puppet6_versions
104114
105- # Verify that it upgraded
106- results = run_task ( 'puppet_agent::version' , 'target' , { } )
107- results . each do |res |
108- expect ( res ) . to include ( 'status' => 'success' )
109- expect ( res [ 'value' ] [ 'version' ] ) . not_to eq ( puppet_6_version )
110- expect ( res [ 'value' ] [ 'version' ] ) . to match ( %r{^6\. \d +\. \d +} )
111- expect ( res [ 'value' ] [ 'source' ] ) . to be
115+ # Upgrade to latest puppet6 version
116+ results = run_task ( 'puppet_agent::install' , 'target' , { 'collection' => 'puppet6' , 'version' => 'latest' } )
117+ expect ( results ) . to all ( include ( 'status' => 'success' ) )
118+
119+ # Verify that it upgraded
120+ results = run_task ( 'puppet_agent::version' , 'target' , { } )
121+ results . each do |res |
122+ expect ( res ) . to include ( 'status' => 'success' )
123+ expect ( res [ 'value' ] [ 'version' ] ) . not_to eq ( puppet_6_version )
124+ expect ( res [ 'value' ] [ 'version' ] ) . to match ( %r{^6\. \d +\. \d +} )
125+ expect ( res [ 'value' ] [ 'source' ] ) . to be
126+ end
112127 end
113128
114129 # Puppet Agent can't be upgraded on Windows nodes while 'puppet agent' service or 'pxp-agent' service are running
0 commit comments