mirror of
https://github.com/kairos-io/kcrypt-challenger.git
synced 2025-04-27 11:00:54 +00:00
Allow test to expect failed installation
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
parent
3c4663afa5
commit
10dcecdc85
@ -24,8 +24,11 @@ var mdnsVM VM
|
||||
var _ = Describe("kcrypt encryption", func() {
|
||||
var config string
|
||||
var vmOpts VMOptions
|
||||
var expectedInstallationSuccess bool
|
||||
|
||||
BeforeEach(func() {
|
||||
expectedInstallationSuccess = true
|
||||
|
||||
vmOpts = DefaultVMOptions()
|
||||
RegisterFailHandler(printInstallationOutput)
|
||||
_, vm = startVM(vmOpts)
|
||||
@ -46,7 +49,9 @@ var _ = Describe("kcrypt encryption", func() {
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
installationOutput, err = vm.Sudo("/bin/bash -c 'set -o pipefail && kairos-agent manual-install --device auto config.yaml 2>&1 | tee manual-install.txt'")
|
||||
Expect(err).ToNot(HaveOccurred(), installationOutput)
|
||||
if expectedInstallationSuccess {
|
||||
Expect(err).ToNot(HaveOccurred(), installationOutput)
|
||||
}
|
||||
})
|
||||
|
||||
AfterEach(func() {
|
||||
@ -329,6 +334,8 @@ install:
|
||||
|
||||
When("the no certificate is set in the configuration", Label("remote-https-bad-cert"), func() {
|
||||
BeforeEach(func() {
|
||||
expectedInstallationSuccess = false
|
||||
|
||||
config = fmt.Sprintf(`#cloud-config
|
||||
|
||||
hostname: metal-{{ trunc 4 .MachineID }}
|
||||
|
Loading…
Reference in New Issue
Block a user