Skip to content

Commit 17fcf46

Browse files
test: add provider test suites
Add comprehensive and networking test configurations for validating the CloudStack Terraform Provider.
1 parent 6f20151 commit 17fcf46

File tree

9 files changed

+720
-0
lines changed

9 files changed

+720
-0
lines changed

tests/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# CloudStack Terraform Provider Test Suites
2+
3+
This directory contains test configurations for validating the CloudStack Terraform Provider.
4+
5+
## Test Suites
6+
7+
### comprehensive/
8+
Full provider feature test covering VMs, networks, volumes, firewall rules, load balancers, and more.
9+
10+
### networking/
11+
Focused test for networking configuration with egress rules.
12+
13+
## Prerequisites
14+
15+
1. CloudStack API credentials:
16+
```bash
17+
export CLOUDSTACK_API_URL="your-api-url"
18+
export CLOUDSTACK_API_KEY="your-api-key"
19+
export CLOUDSTACK_SECRET_KEY="your-secret-key"
20+
```
21+
22+
2. Terraform 1.0+
23+
24+
3. Built provider (for local testing):
25+
```bash
26+
make install
27+
```
28+
29+
## Running Tests
30+
31+
```bash
32+
cd tests/comprehensive # or tests/networking
33+
terraform init
34+
terraform plan
35+
terraform apply
36+
```
37+
38+
## Cleanup
39+
40+
```bash
41+
terraform destroy
42+
```

tests/comprehensive/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Comprehensive Provider Test Suite
2+
3+
Tests the CloudStack Terraform Provider capabilities and identifies limitations.
4+
5+
## Test Coverage
6+
7+
1. SSH Keypair
8+
2. VPC and Networking
9+
3. Isolated Network with Source NAT
10+
4. IP Address allocation
11+
5. Security Groups and Firewall rules
12+
6. Network ACL
13+
7. VM Deployment (2 VMs with cloud-init, SSH keys, affinity groups, tags)
14+
8. Affinity Groups
15+
9. Volumes
16+
10. Volume Attachments
17+
11. Port Forwarding
18+
12. Load Balancer
19+
13. Static NAT
20+
14. Secondary IP
21+
22+
## Usage
23+
24+
```bash
25+
terraform init
26+
terraform plan
27+
terraform apply
28+
terraform destroy
29+
```
30+
31+
## Configuration
32+
33+
Copy terraform.tfvars.example to terraform.tfvars and configure:
34+
35+
- api_url - CloudStack API endpoint
36+
- api_key - API key
37+
- secret_key - API secret
38+
- zone - Zone name
39+
- network_offering - Network offering name
40+
- service_offering - VM service offering
41+
- template - Template name
42+
43+
## Known Limitations
44+
45+
Some resources have stub implementations or missing update functions. See provider documentation for details.

0 commit comments

Comments
 (0)