Skip to content

Commit 787f746

Browse files
committed
hostaggregate: Add import-error test
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
1 parent 5595ced commit 787f746

File tree

6 files changed

+99
-0
lines changed

6 files changed

+99
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
apiVersion: openstack.k-orc.cloud/v1alpha1
3+
kind: HostAggregate
4+
metadata:
5+
name: hostaggregate-import-error-external-1
6+
status:
7+
conditions:
8+
- type: Available
9+
message: OpenStack resource is available
10+
status: "True"
11+
reason: Success
12+
- type: Progressing
13+
message: OpenStack resource is up to date
14+
status: "False"
15+
reason: Success
16+
---
17+
apiVersion: openstack.k-orc.cloud/v1alpha1
18+
kind: HostAggregate
19+
metadata:
20+
name: hostaggregate-import-error-external-2
21+
status:
22+
conditions:
23+
- type: Available
24+
message: OpenStack resource is available
25+
status: "True"
26+
reason: Success
27+
- type: Progressing
28+
message: OpenStack resource is up to date
29+
status: "False"
30+
reason: Success
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
apiVersion: openstack.k-orc.cloud/v1alpha1
3+
kind: HostAggregate
4+
metadata:
5+
name: hostaggregate-import-error-external-1
6+
spec:
7+
cloudCredentialsRef:
8+
cloudName: openstack-admin
9+
secretName: openstack-clouds
10+
managementPolicy: managed
11+
resource: {}
12+
---
13+
apiVersion: openstack.k-orc.cloud/v1alpha1
14+
kind: HostAggregate
15+
metadata:
16+
name: hostaggregate-import-error-external-2
17+
spec:
18+
cloudCredentialsRef:
19+
cloudName: openstack-admin
20+
secretName: openstack-clouds
21+
managementPolicy: managed
22+
resource: {}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestStep
4+
commands:
5+
- command: kubectl create secret generic openstack-clouds --from-file=clouds.yaml=${E2E_KUTTL_OSCLOUDS} ${E2E_KUTTL_CACERT_OPT}
6+
namespaced: true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
apiVersion: openstack.k-orc.cloud/v1alpha1
3+
kind: HostAggregate
4+
metadata:
5+
name: hostaggregate-import-error
6+
status:
7+
conditions:
8+
- type: Available
9+
message: found more than one matching OpenStack resource during import
10+
status: "False"
11+
reason: InvalidConfiguration
12+
- type: Progressing
13+
message: found more than one matching OpenStack resource during import
14+
status: "False"
15+
reason: InvalidConfiguration
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
apiVersion: openstack.k-orc.cloud/v1alpha1
3+
kind: HostAggregate
4+
metadata:
5+
name: hostaggregate-import-error
6+
spec:
7+
cloudCredentialsRef:
8+
cloudName: openstack-admin
9+
secretName: openstack-clouds
10+
managementPolicy: unmanaged
11+
import:
12+
filter:
13+
description: HostAggregate from "import error" test
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Import HostAggregate with more than one matching resources
2+
3+
## Step 00
4+
5+
Create two HostAggregates with identical specs.
6+
7+
## Step 01
8+
9+
Ensure that an imported HostAggregate with a filter matching the resources returns an error.
10+
11+
## Reference
12+
13+
https://k-orc.cloud/development/writing-tests/#import-error

0 commit comments

Comments
 (0)