Skip to content

Commit

Permalink
F #247 Add IPv6 support doc and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frousselet committed May 4, 2022
1 parent 8a2fbe8 commit 51a2fa9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ENHANCEMENTS:

FEATURES:

* resources/opennebula_virtual_machine: Add 'on_disk_change' property to opennebula_virtual_machine
* resources/opennebula_virtual_machine: Add `on_disk_change`, `computed_ip6_global` and `computed_ip6_link` properties
* **New Resource**: opennebula_group_admins

DEPRECATION:
Expand Down
31 changes: 31 additions & 0 deletions opennebula/resource_opennebula_virtual_machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func TestAccVirtualMachine(t *testing.T) {
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "gid"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "uname"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "gname"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "gid"),
testAccCheckVirtualMachinePermissions(&shared.Permissions{
OwnerU: 1,
OwnerM: 1,
Expand Down Expand Up @@ -391,6 +392,8 @@ func TestAccVirtualMachineNICUpdate(t *testing.T) {
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "name", "test-virtual_machine"),
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.#", "1"),
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.0.computed_ip", "172.16.100.131"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_link"),
),
},
{
Expand All @@ -400,6 +403,10 @@ func TestAccVirtualMachineNICUpdate(t *testing.T) {
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.#", "2"),
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.0.computed_ip", "172.16.100.131"),
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.1.computed_ip", "172.16.100.132"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_link"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_link"),
),
},
{
Expand All @@ -409,6 +416,10 @@ func TestAccVirtualMachineNICUpdate(t *testing.T) {
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.#", "2"),
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.0.computed_ip", "172.16.100.131"),
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.1.computed_ip", "172.16.100.111"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_link"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_link"),
),
},
{
Expand All @@ -418,6 +429,10 @@ func TestAccVirtualMachineNICUpdate(t *testing.T) {
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.#", "2"),
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.0.computed_ip", "172.16.100.131"),
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.1.computed_ip", "172.16.100.112"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_link"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_link"),
),
},
{
Expand All @@ -430,6 +445,14 @@ func TestAccVirtualMachineNICUpdate(t *testing.T) {
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.1.computed_ip", "172.16.100.132"),
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.2.computed_ip", "172.16.100.113"),
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.3.computed_ip", "172.16.100.133"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.2.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.3.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_link"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_link"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.2.computed_ip6_link"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.3.computed_ip6_link"),
),
},
{
Expand All @@ -442,6 +465,14 @@ func TestAccVirtualMachineNICUpdate(t *testing.T) {
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.1.computed_ip", "172.16.100.134"),
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.2.computed_ip", "172.16.100.113"),
resource.TestCheckResourceAttr("opennebula_virtual_machine.test", "nic.3.computed_ip", "172.16.100.133"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.2.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.3.computed_ip6_global"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.0.computed_ip6_link"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.1.computed_ip6_link"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.2.computed_ip6_link"),
resource.TestCheckResourceAttrSet("opennebula_virtual_machine.test", "nic.3.computed_ip6_link"),
),
},
{
Expand Down
4 changes: 4 additions & 0 deletions website/docs/r/virtual_machine.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ The following attribute are exported:
* `nic_id` - nic attachment identifier
* `network` - network name
* `computed_ip` - IP of the virtual machine on this network.
* `computed_ip6_global` - IPv6 of the virtual machine on this network.
* `computed_ip6_link` - Link Local IPv6 of the virtual machine on this network.
* `computed_mac` - MAC of the virtual machine on this network.
* `computed_model` - Nic model driver.
* `computed_virtio_queues` - Virtio multi-queue size.
Expand All @@ -195,6 +197,8 @@ The following attribute are exported:
* `nic_id` - nic attachment identifier
* `network` - network name
* `computed_ip` - IP of the virtual machine on this network.
* `computed_ip6_global` - IPv6 of the virtual machine on this network.
* `computed_ip6_link` - Link Local IPv6 of the virtual machine on this network.
* `computed_mac` - MAC of the virtual machine on this network.
* `computed_model` - Nic model driver.
* `computed_virtio_queues` - Virtio multi-queue size.
Expand Down

0 comments on commit 51a2fa9

Please sign in to comment.