-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(api): refactor e2e label and annotation test case (#515)
- adapt existing label and annotation test case to updated API - fix typo and improve test cases contexts Signed-off-by: Roman Sysoev <[email protected]>
- Loading branch information
1 parent
7ea5bae
commit 41908ae
Showing
24 changed files
with
516 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/e2e/testdata/vm-label-annotation/base/cfg/cloudinit.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#cloud-config | ||
users: | ||
- name: cloud | ||
# passwd: cloud | ||
passwd: $6$rounds=4096$vln/.aPHBOI7BMYR$bBMkqQvuGs5Gyd/1H5DP4m9HjQSy.kgrxpaGEHwkX7KEFV8BS.HZWPitAtZ2Vd8ZqIZRqmlykRCagTgPejt1i. | ||
shell: /bin/bash | ||
sudo: ALL=(ALL) NOPASSWD:ALL | ||
chpasswd: { expire: False } | ||
lock_passwd: false | ||
ssh_authorized_keys: | ||
# testcases | ||
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFxcXHmwaGnJ8scJaEN5RzklBPZpVSic4GdaAsKjQoeA [email protected] |
14 changes: 14 additions & 0 deletions
14
tests/e2e/testdata/vm-label-annotation/base/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./vm.yaml | ||
- ./vd-root.yaml | ||
configurations: | ||
- transformer.yaml | ||
generatorOptions: | ||
disableNameSuffixHash: true | ||
secretGenerator: | ||
- files: | ||
- userData=cfg/cloudinit.yaml | ||
name: cloud-init | ||
type: provisioning.virtualization.deckhouse.io/cloud-init |
54 changes: 54 additions & 0 deletions
54
tests/e2e/testdata/vm-label-annotation/base/transformer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# https://github.com/kubernetes-sigs/kustomize/blob/master/examples/transformerconfigs/README.md#transformer-configurations | ||
|
||
namespace: | ||
- kind: ClusterVirtualImage | ||
path: spec/dataSource/objectRef/namespace | ||
nameReference: | ||
- kind: VirtualImage | ||
version: v1alpha2 # optional | ||
fieldSpecs: | ||
- path: spec/dataSource/objectRef/name | ||
kind: ClusterVirtualImage | ||
- path: spec/dataSource/objectRef/name | ||
kind: VirtualImage | ||
- path: spec/dataSource/objectRef/name | ||
kind: VirtualDisk | ||
- path: spec/blockDeviceRefs/name | ||
kind: VirtualMachine | ||
- kind: ClusterVirtualImage | ||
version: v1alpha2 # optional | ||
fieldSpecs: | ||
- path: spec/dataSource/objectRef/name | ||
kind: ClusterVirtualImage | ||
- path: spec/dataSource/objectRef/name | ||
kind: VirtualImage | ||
- path: spec/dataSource/objectRef/name | ||
kind: VirtualDisk | ||
- path: spec/blockDeviceRefs/name | ||
kind: VirtualMachine | ||
- kind: VirtualDisk | ||
version: v1alpha2 # optional | ||
fieldSpecs: | ||
- path: spec/blockDeviceRefs/name | ||
kind: VirtualMachine | ||
- path: spec/blockDeviceRef/name | ||
kind: VirtualMachineBlockDeviceAttachment | ||
- kind: Secret | ||
fieldSpecs: | ||
- path: spec/provisioning/userDataRef/name | ||
kind: VirtualMachine | ||
- kind: VirtualMachineIPAddress | ||
version: v1alpha2 | ||
fieldSpecs: | ||
- path: spec/virtualMachineIPAddressName | ||
kind: VirtualMachine | ||
- kind: VirtualMachine | ||
version: v1alpha2 | ||
fieldSpecs: | ||
- path: spec/virtualMachineName | ||
kind: VirtualMachineBlockDeviceAttachment | ||
- kind: VirtualMachineClass | ||
version: v1alpha2 | ||
fieldSpecs: | ||
- path: spec/virtualMachineClassName | ||
kind: VirtualMachine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: virtualization.deckhouse.io/v1alpha2 | ||
kind: VirtualDisk | ||
metadata: | ||
name: vd-root | ||
spec: | ||
persistentVolumeClaim: | ||
size: 512Mi | ||
dataSource: | ||
type: ObjectRef | ||
objectRef: | ||
kind: VirtualImage | ||
name: vi-alpine-http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: virtualization.deckhouse.io/v1alpha2 | ||
kind: VirtualMachine | ||
metadata: | ||
name: vm | ||
spec: | ||
virtualMachineClassName: generic | ||
cpu: | ||
cores: 1 | ||
coreFraction: 5% | ||
memory: | ||
size: 256Mi | ||
disruptions: | ||
restartApprovalMode: Manual | ||
provisioning: | ||
type: UserDataRef | ||
userDataRef: | ||
kind: Secret | ||
name: cloud-init | ||
blockDeviceRefs: | ||
- kind: VirtualDisk | ||
name: vd-root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: testcases | ||
namePrefix: pr-number-or-commit-hash- | ||
resources: | ||
- ns.yaml | ||
- vi | ||
- overlays/vm-label-annotation | ||
configurations: | ||
- transformer.yaml | ||
labels: | ||
- includeSelectors: true | ||
pairs: | ||
id: pr-number-or-commit-hash | ||
testcase: vm-label-annotation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: default |
20 changes: 20 additions & 0 deletions
20
tests/e2e/testdata/vm-label-annotation/overlays/vm-label-annotation/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
nameSuffix: -label-annotation | ||
resources: | ||
- ../../base | ||
patches: | ||
- patch: |- | ||
- op: replace | ||
path: /spec/runPolicy | ||
value: AlwaysOn | ||
target: | ||
kind: VirtualMachine | ||
name: vm | ||
- patch: |- | ||
- op: replace | ||
path: /spec/disruptions/restartApprovalMode | ||
value: Automatic | ||
target: | ||
kind: VirtualMachine | ||
name: vm |
Oops, something went wrong.