diff options
author | tpowell-progress <104777878+tpowell-progress@users.noreply.github.com> | 2022-08-22 17:01:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-22 17:01:43 -0400 |
commit | 964236952f9fad2398a6a3a2501774e430b17b6d (patch) | |
tree | 34fc831f1a43920ffc38b743b423c41a6090db34 | |
parent | 612749ee73e4f15b6edd1123d07d231d9b2fbf87 (diff) | |
parent | 68c1b9b4d48df8dba26a93c199160229a74b5fbd (diff) | |
download | chef-964236952f9fad2398a6a3a2501774e430b17b6d.tar.gz |
Merge pull request #13139 from chef/tp/INFC-253-badssl-test
Update expired cert for kitchen tests
-rw-r--r-- | cspell.json | 4 | ||||
-rw-r--r-- | kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_trusted_certificate.rb | 16 | ||||
-rw-r--r-- | kitchen-tests/cookbooks/end_to_end/recipes/linux.rb | 11 | ||||
-rw-r--r-- | kitchen-tests/cookbooks/end_to_end/recipes/windows.rb | 53 |
4 files changed, 72 insertions, 12 deletions
diff --git a/cspell.json b/cspell.json index 5d62456013..5216cdb1d6 100644 --- a/cspell.json +++ b/cspell.json @@ -394,6 +394,7 @@ "fmri", "fname", "foorb", + "FORCECLOSEAPPLICATIONS", "FORCEMINIMIZE", "FORCEOFFFEEDBACK", "FORCEONFEEDBACK", @@ -991,6 +992,7 @@ "PRINTPROCESSOR", "PRINTQ", "PROCNUM", + "processname", "procs", "progname", "PROMPTSTRUCT", @@ -1214,6 +1216,7 @@ "signedheaderauth", "SIGQUIT", "SIGUSR", + "silentlycontinue", "SINGLELINE", "singleline", "Singleuser", @@ -1371,6 +1374,7 @@ "unformatter", "unhold", "unignored", + "unins", "uninst", "unintuitive", "unixy", diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_trusted_certificate.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_trusted_certificate.rb index e719a01837..e085519c4a 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_trusted_certificate.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_trusted_certificate.rb @@ -1,10 +1,10 @@ chef_client_trusted_certificate "self-signed.badssl.com" do certificate <<~CERT -----BEGIN CERTIFICATE----- -MIIDeTCCAmGgAwIBAgIJALvxdCPEMG1VMA0GCSqGSIb3DQEBCwUAMGIxCzAJBgNV +MIIDeTCCAmGgAwIBAgIJAMtEwC/G1C5xMA0GCSqGSIb3DQEBCwUAMGIxCzAJBgNV BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNp c2NvMQ8wDQYDVQQKDAZCYWRTU0wxFTATBgNVBAMMDCouYmFkc3NsLmNvbTAeFw0y -MjA1MTcyMTE1MjVaFw0yNDA1MTYyMTE1MjVaMGIxCzAJBgNVBAYTAlVTMRMwEQYD +MjA4MTIxNTU5MTBaFw0yNDA4MTExNTU5MTBaMGIxCzAJBgNVBAYTAlVTMRMwEQYD VQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ8wDQYDVQQK DAZCYWRTU0wxFTATBgNVBAMMDCouYmFkc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEB BQADggEPADCCAQoCggEBAMIE7PiM7gTCs9hQ1XBYzJMY61yoaEmwIrX5lZ6xKyx2 @@ -14,12 +14,12 @@ xPxTuW1CrbV8/q71FdIzSOciccfCFHpsKOo3St/qbLVytH5aohbcabFXRNsKEqve ww9HdFxBIuGa+RuT5q0iBikusbpJHAwnnqP7i/dAcgCskgjZjFeEU4EFy+b+a1SY QCeFxxC7c3DvaRhBB0VVfPlkPz0sw6l865MaTIbRyoUCAwEAAaMyMDAwCQYDVR0T BAIwADAjBgNVHREEHDAaggwqLmJhZHNzbC5jb22CCmJhZHNzbC5jb20wDQYJKoZI -hvcNAQELBQADggEBAI8cPgdGNaXwomKxzksJPMCHQC3zkTKQBqGAk4yWp3w7/WHV -1dTz/ezCH1UpxRUqTIZ/jS7OwrERRJCw6wr84WrKj0TKgZI00LEoRg3eK+U5QJj1 -4HZ8UTVkYL7OhPBanGgACw0eOvFtLdwizBTAw+B79Uzx0j84babX8HFq8UJR997H -FN+Fo9w4+ObXiA6BB9+fsqhRKPcIvt4HI6eQ4S/5lBkZbhHIPSR5oy4y7AsnZeb8 -hFNhP/WPdRvk4za0cAkuhoY5/3A/U4eFrXYL4N8mhqiRWvqbSaBT2YnlbSVxEDQM -CJWRCL+Lq4ZHGYgXSi1T0/LJHSlOa1F5qhZpk9A= +hvcNAQELBQADggEBAKgnD+Ak7ttVfKvriYAsf4ttTYfOuyLfAr4hTTSXLN2u1ySD +fIpqSyeOkiEwfD5Bt7C/muEXEIyG/y6/C/ozb5JBvdd8c7zicLmaHtZtZbj4+H1b +/gqaBHuvWxiRR91bbgNaKsPMGCWiAvUt4/+y8z6xefUS+aKeFNhYjdwyFIr17j3Q +gxGpgCbYLLIoewP+Oj6xvZgGl6vj0xW9a4144xjFo1o1vqWkj+3IZGmnZ/jyznWd +5XzZCUaM9z6nn7NVxQZEelk885Q3oUxY96rRO+IUA8Vnk3iEtOdZPbNBaZwvgkfz +4vhvM8gKbdeeWoOAJDLzDZiDrUpKtIkBcLuJ7Cw= -----END CERTIFICATE----- CERT end diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb b/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb index 079f66f511..01268d320f 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb @@ -44,10 +44,13 @@ include_recipe "::_chef_gem" include_recipe "ntp" unless fedora? # fedora 34+ doesn't have NTP -resolver_config "/etc/resolv.conf" do - nameservers [ "8.8.8.8", "8.8.4.4" ] - search [ "chef.io" ] -end +# FIXME linux docker images seem to produce +# EBUSY errors on moving or writing to /etc/resolv.conf +# +# resolver_config "/etc/resolv.conf" do +# nameservers [ "8.8.8.8", "8.8.4.4" ] +# search [ "chef.io" ] +# end users_from_databag = search("users", "*:*") diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb index d37174edd2..0c60bf1b0f 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb @@ -13,6 +13,59 @@ chef_sleep "2" execute "dir" +execute "Print git version" do + command "git --version & git --exec-path" + live_stream true +end + +# FIXME Uninstall git using powershell +# this is a temporary band-aid due to the fallback git version in +# https://github.com/sous-chefs/git defaulting to an older version of git +# than will be installed on the current image this runs in for GitHub Actions +powershell_script "uninstall_git" do + code <<-EOH + $possibleInstalledPaths = @("C:/Program Files/Git/", "C:/Program Files (x64)/Git/", "c:/git/") + $foundAnInstallation = $false + ### For all places where Git "could" be. + foreach ($installPath in $possibleInstalledPaths) + { + ### If the path where Git could exist + if (Test-Path($installPath)) + { + ## Some Git stuff might be running.. kill them. + Stop-Process -processname Bash -erroraction 'silentlycontinue' + Stop-Process -processname Putty* -erroraction 'silentlycontinue' + + $foundAnInstallation = $true + Write-Host "Removing Git from " $installPath + + ### Find if there's an uninstaller in the folder. + $uninstallers = Get-ChildItem $installPath"unins*.exe" + + ### In reality, there should only be just one that matches. + foreach ($uninstaller in $uninstallers) + { + ### Invoke the uninstaller. + $uninstallerCommandLineOptions = "/SP- /VERYSILENT /SUPPRESSMSGBOXES /FORCECLOSEAPPLICATIONS" + Start-Process -Wait -FilePath $uninstaller -ArgumentList $uninstallerCommandLineOptions + } + + ### Remove the folder if it didn't clean up properly. + if (Test-Path($installPath)) + { + Remove-Item -Recurse -Force $installPath + } + } + } + + if (!($foundAnInstallation)) + { + Write-Host "No git installation found. Nothing to uninstall" + } + EOH + live_stream true +end + powershell_script "sleep 1 second" do code "Start-Sleep -s 1" live_stream true |