mirror of
https://github.com/kairos-io/kcrypt-challenger.git
synced 2025-04-27 19:05:23 +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 _ = Describe("kcrypt encryption", func() {
|
||||||
var config string
|
var config string
|
||||||
var vmOpts VMOptions
|
var vmOpts VMOptions
|
||||||
|
var expectedInstallationSuccess bool
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
|
expectedInstallationSuccess = true
|
||||||
|
|
||||||
vmOpts = DefaultVMOptions()
|
vmOpts = DefaultVMOptions()
|
||||||
RegisterFailHandler(printInstallationOutput)
|
RegisterFailHandler(printInstallationOutput)
|
||||||
_, vm = startVM(vmOpts)
|
_, vm = startVM(vmOpts)
|
||||||
@ -46,7 +49,9 @@ var _ = Describe("kcrypt encryption", func() {
|
|||||||
Expect(err).ToNot(HaveOccurred())
|
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'")
|
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() {
|
AfterEach(func() {
|
||||||
@ -329,6 +334,8 @@ install:
|
|||||||
|
|
||||||
When("the no certificate is set in the configuration", Label("remote-https-bad-cert"), func() {
|
When("the no certificate is set in the configuration", Label("remote-https-bad-cert"), func() {
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
|
expectedInstallationSuccess = false
|
||||||
|
|
||||||
config = fmt.Sprintf(`#cloud-config
|
config = fmt.Sprintf(`#cloud-config
|
||||||
|
|
||||||
hostname: metal-{{ trunc 4 .MachineID }}
|
hostname: metal-{{ trunc 4 .MachineID }}
|
||||||
|
Loading…
Reference in New Issue
Block a user