@@ -98,11 +98,11 @@ checkVars()
9898 ls -1 ../vagrant/Vagrantfile.* | cut -d. -f4
9999 exit 1
100100 fi
101- if [[ " $runTest " == true && " $testNativeBuild " == false ]]; then
101+ if [[ " $runTest " == true && " $testNativeBuild " == false ]]; then
102102 echo " Unable to test an unbuilt JDK. Ignoring '--test' argument."
103103 runTest=false
104104 fi
105- # Sets WORKSPACE to home if WORKSPACE is empty or undefined.
105+ # Sets WORKSPACE to home if WORKSPACE is empty or undefined.
106106 if [ ! -n " ${WORKSPACE:- } " ]; then
107107 echo " WORKSPACE not found, setting it as environment variable 'HOME'"
108108 WORKSPACE=$HOME
@@ -151,15 +151,15 @@ checkVagrantOS()
151151 local vagrantOSList
152152 if [[ " $newVagrantFiles " = " true" ]]; then
153153 cd ${WORKSPACE} /adoptopenjdkPBTests/${gitFork} -${newGitBranch} /ansible/vagrant
154- else
154+ else
155155 cd ${scriptPath%/* } /../vagrant
156156 fi
157157 vagrantOSList=$( ls -1 Vagrantfile.* | cut -d. -f 2)
158158 if [[ -f " Vagrantfile.${vagrantOS} " ]]; then
159159 echo " Vagrantfile Detected"
160160 elif [[ " $vagrantOS " == " all" ]]; then
161161 vagrantOS=$vagrantOSList
162- else
162+ else
163163 echo " No Vagrantfile for $vagrantOS available - please select from one of the following"
164164 echo $vagrantOSList
165165 exit 1
@@ -224,7 +224,7 @@ startVMPlaybook()
224224 rm -f id_rsa.pub id_rsa
225225 ssh-keygen -q -f $PWD /id_rsa -t rsa -N ' '
226226
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
228228 # See https://github.com/adoptium/infrastructure/issues/1287#issuecomment-625142917
229229 BUILD_ID=dontKillMe vagrant up
230230 vagrantPORT=$( vagrant port | grep host | awk ' { print $4 }' )
@@ -235,14 +235,14 @@ startVMPlaybook()
235235 # ssh-keygen -R will fail if the known_hosts file does not exist
236236 [ ! -r $HOME /.ssh/known_hosts ] && touch $HOME /.ssh/known_hosts && chmod 644 $HOME /.ssh/known_hosts
237237 ssh-keygen -R $( cat playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx)
238-
238+
239239 sed -i -e " s/.*hosts:.*/ hosts: all/g" playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
240240 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+
242242 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
243243 echo The playbook finished at : ` date +%T`
244244 if ! grep -q ' unreachable=0.*failed=0' $pbLogPath ; then
245- echo PLAYBOOK FAILED
245+ echo PLAYBOOK FAILED
246246 exit 1
247247 fi
248248
@@ -306,7 +306,7 @@ startVMPlaybookWin()
306306 # The BUILD_ID variable is required to stop Jenkins shutting down the wrong VMS
307307 # See https://github.com/adoptium/infrastructure/issues/1287#issuecomment-625142917
308308 BUILD_ID=dontKillMe vagrant up
309-
309+
310310 # Rearm the evaluation license for 180 days to stop the VMs shutting down
311311 # See: https://github.com/adoptium/infrastructure/issues/2056
312312 vagrant winrm --shell cmd -c " slmgr.vbs /rearm //b"
@@ -317,7 +317,7 @@ startVMPlaybookWin()
317317 vagrantPort=$( vagrant port | awk ' /5986/ { print $4 }' )
318318 echo " [127.0.0.1]:$vagrantPort " >> playbooks/AdoptOpenJDK_Windows_Playbook/hosts.win
319319 echo " This is the content of hosts.win : " && cat playbooks/AdoptOpenJDK_Windows_Playbook/hosts.win
320-
320+
321321 # Changes the value of "hosts" in main.yml
322322 sed -i' ' -e " s/.*hosts:.*/ hosts: all/g" playbooks/AdoptOpenJDK_Windows_Playbook/main.yml
323323 # Uncomments and sets the ansible_password to 'vagrant', in adoptopenjdk_variables.yml
@@ -328,17 +328,20 @@ startVMPlaybookWin()
328328 # Add the "ansible_winrm_transport" to adoptopenjdk_variables.yml
329329 echo -e " \nansible_winrm_transport: credssp" >> playbooks/AdoptOpenJDK_Windows_Playbook/group_vars/all/adoptopenjdk_variables.yml
330330 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+
332335 gitSha=$( git rev-parse HEAD)
333336
334337 # Run the ansible playbook on the VM & logs the output.
335338 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
336339 echo The playbook finished at : ` date +%T`
337340 if ! grep -q ' unreachable=0.*failed=0' $pbLogPath ; then
338- echo PLAYBOOK FAILED
341+ echo PLAYBOOK FAILED
339342 exit 1
340343 fi
341-
344+
342345 if [[ " $testNativeBuild " = true ]]; then
343346 local buildLogPath=" $WORKSPACE /adoptopenjdkPBTests/logFiles/${gitFork} .${newGitBranch} .$OS .build_log"
344347
@@ -356,14 +359,14 @@ startVMPlaybookWin()
356359 echo BUILD FAILED
357360 exit 127
358361 fi
359-
362+
360363 if [[ " $runTest " = true ]]; then
361364 local testLogPath=" $WORKSPACE /adoptopenjdkPBTests/logFiles/${gitFork} .${newGitBranch} .$OS .test_log"
362-
365+
363366 # Run a python script to start a test for the built JDK on the Windows VM
364367 python pbTestScripts/startScriptWin.py -i " 127.0.0.1:$vagrantPort " -t 2>&1 | tee $testLogPath
365368 echo The test finished at : ` date +%T`
366- if ! grep -q ' FAILED: 0' $testLogPath ; then
369+ if ! grep -q ' FAILED: 0' $testLogPath ; then
367370 echo TEST FAILED
368371 exit 127
369372 fi
@@ -409,13 +412,14 @@ checkVagrantOS
409412echo " Testing on the following OSs: $vagrantOS "
410413for OS in $vagrantOS
411414do
412- if [[ " $OS " == " Win2012" ]] ; then
415+ echo OS = $vagrantOS
416+ if [[ " $OS " == " Win2012" || " $OS " == " Win2022" ]] ; then
413417 startVMPlaybookWin $OS
414418 else
415419 startVMPlaybook $OS
416420 fi
417421 if [[ " $vmHalt " == true ]]; then
418- vagrant halt
422+ vagrant halt
419423 fi
420424done
421425destroyVM
0 commit comments