Skip to content

Commit

Permalink
Add tests for 'allow_extension_operations'
Browse files Browse the repository at this point in the history
Signed-off-by: philthoennissen <pth@cloudeteer.de>
  • Loading branch information
Phil-Thoennissen committed Oct 22, 2024
1 parent 24d4e59 commit 2d90050
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/local/input_vm_extension.tftest.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
mock_provider "azapi" { source = "tests/local/mocks" }
mock_provider "azurerm" { source = "tests/local/mocks" }
mock_provider "random" { source = "tests/local/mocks" }
mock_provider "tls" { source = "tests/local/mocks" }

run "no_extension_should_be_created" {
command = plan

variables {
allow_extension_operations = false
extensions = []
}

assert {
condition = length(azurerm_virtual_machine_extension.this) == 0
error_message = "It is not possible to install extension with 'allow_extension_operations = false'. The azurerm_virtual_machine_extension.this length is ${length(azurerm_virtual_machine_extension.this)}."
}
}

run "no_extension_should_be_created_2" {
command = plan

variables {
allow_extension_operations = false
}

assert {
condition = length(azurerm_virtual_machine_extension.this) == 0
error_message = "It is not possible to install extension with 'allow_extension_operations = false'. The azurerm_virtual_machine_extension.this length is ${length(azurerm_virtual_machine_extension.this)}."
}
}

0 comments on commit 2d90050

Please sign in to comment.