Skip to content

Commit

Permalink
Merge pull request #433 from linode/test_vpc
Browse files Browse the repository at this point in the history
added_vpc_tests
  • Loading branch information
vshanthe authored Oct 26, 2023
2 parents 93f7659 + 9feba1e commit d98a9b8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
18 changes: 18 additions & 0 deletions tests/integration/targets/vpc_basic/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
- create_vpc.vpc.region == 'us-east'
- create_vpc.vpc.description == 'test description'

- name: Create a VPC with invalid label
linode.cloud.vpc:
label: 'test-vpc!!'
region: us-east
description: test description
state: present
register: invalid_label
failed_when: "'Label must include only ASCII letters, numbers, and dashes' not in invalid_label.msg"

- name: Update the VPC
linode.cloud.vpc:
label: 'ansible-test-{{ r }}'
Expand All @@ -34,6 +43,15 @@
- update_vpc.vpc.id == create_vpc.vpc.id
- update_vpc.vpc.description == 'test description updated'

- name: Update the VPC with invalid label
linode.cloud.vpc:
label: 'ansible-test-{{ r }}!'
region: us-east
description: test description updated
state: present
register: modify_vpc
failed_when: "'Label must include only ASCII letters, numbers, and dashes' not in modify_vpc.msg"

- name: Don't update the VPC
linode.cloud.vpc:
label: 'ansible-test-{{ r }}'
Expand Down
9 changes: 9 additions & 0 deletions tests/integration/targets/vpc_subnet/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
- create_subnet.subnet.updated != None
- create_subnet.subnet.linodes | length == 0

- name: Create a subnet with invalid label
linode.cloud.vpc_subnet:
vpc_id: '{{ create_vpc.vpc.id }}'
label: 'subnet-invalid!!'
ipv4: '10.0.0.0/24'
state: present
register: invalid_subnet
failed_when: "'Label must include only ASCII letters, numbers, and dashes' not in invalid_subnet.msg"

- name: List Subnets
linode.cloud.vpc_subnet_list:
vpc_id: '{{ create_vpc.vpc.id }}'
Expand Down

0 comments on commit d98a9b8

Please sign in to comment.