@@ -98,11 +98,11 @@ checkVars()
98
98
ls -1 ../vagrant/Vagrantfile.* | cut -d. -f4
99
99
exit 1
100
100
fi
101
- if [[ " $runTest " == true && " $testNativeBuild " == false ]]; then
101
+ if [[ " $runTest " == true && " $testNativeBuild " == false ]]; then
102
102
echo " Unable to test an unbuilt JDK. Ignoring '--test' argument."
103
103
runTest=false
104
104
fi
105
- # Sets WORKSPACE to home if WORKSPACE is empty or undefined.
105
+ # Sets WORKSPACE to home if WORKSPACE is empty or undefined.
106
106
if [ ! -n " ${WORKSPACE:- } " ]; then
107
107
echo " WORKSPACE not found, setting it as environment variable 'HOME'"
108
108
WORKSPACE=$HOME
@@ -151,15 +151,15 @@ checkVagrantOS()
151
151
local vagrantOSList
152
152
if [[ " $newVagrantFiles " = " true" ]]; then
153
153
cd ${WORKSPACE} /adoptopenjdkPBTests/${gitFork} -${newGitBranch} /ansible/vagrant
154
- else
154
+ else
155
155
cd ${scriptPath%/* } /../vagrant
156
156
fi
157
157
vagrantOSList=$( ls -1 Vagrantfile.* | cut -d. -f 2)
158
158
if [[ -f " Vagrantfile.${vagrantOS} " ]]; then
159
159
echo " Vagrantfile Detected"
160
160
elif [[ " $vagrantOS " == " all" ]]; then
161
161
vagrantOS=$vagrantOSList
162
- else
162
+ else
163
163
echo " No Vagrantfile for $vagrantOS available - please select from one of the following"
164
164
echo $vagrantOSList
165
165
exit 1
@@ -224,7 +224,7 @@ startVMPlaybook()
224
224
rm -f id_rsa.pub id_rsa
225
225
ssh-keygen -q -f $PWD /id_rsa -t rsa -N ' '
226
226
227
- # The BUILD_ID variable is required to stop Jenkins shutting down the wrong VMS
227
+ # The BUILD_ID variable is required to stop Jenkins shutting down the wrong VMS
228
228
# See https://github.com/adoptium/infrastructure/issues/1287#issuecomment-625142917
229
229
BUILD_ID=dontKillMe vagrant up
230
230
vagrantPORT=$( vagrant port | grep host | awk ' { print $4 }' )
@@ -235,14 +235,14 @@ startVMPlaybook()
235
235
# ssh-keygen -R will fail if the known_hosts file does not exist
236
236
[ ! -r $HOME /.ssh/known_hosts ] && touch $HOME /.ssh/known_hosts && chmod 644 $HOME /.ssh/known_hosts
237
237
ssh-keygen -R $( cat playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx)
238
-
238
+
239
239
sed -i -e " s/.*hosts:.*/ hosts: all/g" playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
240
240
awk ' {print}/^\[defaults\]$/{print "private_key_file = id_rsa"; print "remote_tmp = $HOME/.ansible/tmp"; print "timeout = 60"}' < ansible.cfg > ansible.cfg.tmp && mv ansible.cfg.tmp ansible.cfg
241
-
241
+
242
242
ansible-playbook $verbosity -i playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx -u vagrant -b --skip-tags adoptopenjdk,jenkins${skipFullSetup} playbooks/AdoptOpenJDK_Unix_Playbook/main.yml 2>&1 | tee $WORKSPACE /adoptopenjdkPBTests/logFiles/$gitFork .$newGitBranch .$OS .log
243
243
echo The playbook finished at : ` date +%T`
244
244
if ! grep -q ' unreachable=0.*failed=0' $pbLogPath ; then
245
- echo PLAYBOOK FAILED
245
+ echo PLAYBOOK FAILED
246
246
exit 1
247
247
fi
248
248
@@ -306,7 +306,7 @@ startVMPlaybookWin()
306
306
# The BUILD_ID variable is required to stop Jenkins shutting down the wrong VMS
307
307
# See https://github.com/adoptium/infrastructure/issues/1287#issuecomment-625142917
308
308
BUILD_ID=dontKillMe vagrant up
309
-
309
+
310
310
# Rearm the evaluation license for 180 days to stop the VMs shutting down
311
311
# See: https://github.com/adoptium/infrastructure/issues/2056
312
312
vagrant winrm --shell cmd -c " slmgr.vbs /rearm //b"
@@ -317,7 +317,7 @@ startVMPlaybookWin()
317
317
vagrantPort=$( vagrant port | awk ' /5986/ { print $4 }' )
318
318
echo " [127.0.0.1]:$vagrantPort " >> playbooks/AdoptOpenJDK_Windows_Playbook/hosts.win
319
319
echo " This is the content of hosts.win : " && cat playbooks/AdoptOpenJDK_Windows_Playbook/hosts.win
320
-
320
+
321
321
# Changes the value of "hosts" in main.yml
322
322
sed -i' ' -e " s/.*hosts:.*/ hosts: all/g" playbooks/AdoptOpenJDK_Windows_Playbook/main.yml
323
323
# Uncomments and sets the ansible_password to 'vagrant', in adoptopenjdk_variables.yml
@@ -328,17 +328,20 @@ startVMPlaybookWin()
328
328
# Add the "ansible_winrm_transport" to adoptopenjdk_variables.yml
329
329
echo -e " \nansible_winrm_transport: credssp" >> playbooks/AdoptOpenJDK_Windows_Playbook/group_vars/all/adoptopenjdk_variables.yml
330
330
fi
331
-
331
+ # Add The Ansible WinRM TimeOut Values To The Vars file
332
+ echo " ansible_winrm_operation_timeout_sec: 600" >> playbooks/AdoptOpenJDK_Windows_Playbook/group_vars/all/adoptopenjdk_variables.yml
333
+ echo " ansible_winrm_read_timeout_sec: 630" >> playbooks/AdoptOpenJDK_Windows_Playbook/group_vars/all/adoptopenjdk_variables.yml
334
+
332
335
gitSha=$( git rev-parse HEAD)
333
336
334
337
# Run the ansible playbook on the VM & logs the output.
335
338
ansible-playbook $verbosity -i playbooks/AdoptOpenJDK_Windows_Playbook/hosts.win -u vagrant --extra-vars " git_sha=${gitSha} " --skip-tags jenkins,adoptopenjdk${skipFullSetup} playbooks/AdoptOpenJDK_Windows_Playbook/main.yml 2>&1 | tee $pbLogPath
336
339
echo The playbook finished at : ` date +%T`
337
340
if ! grep -q ' unreachable=0.*failed=0' $pbLogPath ; then
338
- echo PLAYBOOK FAILED
341
+ echo PLAYBOOK FAILED
339
342
exit 1
340
343
fi
341
-
344
+
342
345
if [[ " $testNativeBuild " = true ]]; then
343
346
local buildLogPath=" $WORKSPACE /adoptopenjdkPBTests/logFiles/${gitFork} .${newGitBranch} .$OS .build_log"
344
347
@@ -356,14 +359,14 @@ startVMPlaybookWin()
356
359
echo BUILD FAILED
357
360
exit 127
358
361
fi
359
-
362
+
360
363
if [[ " $runTest " = true ]]; then
361
364
local testLogPath=" $WORKSPACE /adoptopenjdkPBTests/logFiles/${gitFork} .${newGitBranch} .$OS .test_log"
362
-
365
+
363
366
# Run a python script to start a test for the built JDK on the Windows VM
364
367
python pbTestScripts/startScriptWin.py -i " 127.0.0.1:$vagrantPort " -t 2>&1 | tee $testLogPath
365
368
echo The test finished at : ` date +%T`
366
- if ! grep -q ' FAILED: 0' $testLogPath ; then
369
+ if ! grep -q ' FAILED: 0' $testLogPath ; then
367
370
echo TEST FAILED
368
371
exit 127
369
372
fi
@@ -409,13 +412,14 @@ checkVagrantOS
409
412
echo " Testing on the following OSs: $vagrantOS "
410
413
for OS in $vagrantOS
411
414
do
412
- if [[ " $OS " == " Win2012" ]] ; then
415
+ echo OS = $vagrantOS
416
+ if [[ " $OS " == " Win2012" || " $OS " == " Win2022" ]] ; then
413
417
startVMPlaybookWin $OS
414
418
else
415
419
startVMPlaybook $OS
416
420
fi
417
421
if [[ " $vmHalt " == true ]]; then
418
- vagrant halt
422
+ vagrant halt
419
423
fi
420
424
done
421
425
destroyVM
0 commit comments