-
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): add e2e vm configuration test (#373)
- Increase SSH connection timeout(required in some cases). - Refactor helper functions. - Optimize config file fields. - Fix golangci-lint errors. Signed-off-by: Roman Sysoev <roman.sysoev@flant.com>
- Loading branch information
1 parent
f98dba8
commit 6219dcd
Showing
30 changed files
with
633 additions
and
84 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
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-configuration/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 your_email@example.com |
15 changes: 15 additions & 0 deletions
15
tests/e2e/testdata/vm-configuration/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,15 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./vm.yaml | ||
- ./vd-root.yaml | ||
- ./vd-blank.yaml | ||
configurations: | ||
- transformer.yaml | ||
generatorOptions: | ||
disableNameSuffixHash: true | ||
secretGenerator: | ||
- files: | ||
- userdata=cfg/cloudinit.yaml | ||
name: cloud-init | ||
type: Opaque |
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,7 @@ | ||
apiVersion: virtualization.deckhouse.io/v1alpha2 | ||
kind: VirtualDisk | ||
metadata: | ||
name: vd-attach | ||
spec: | ||
persistentVolumeClaim: | ||
size: 100Mi |
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,7 @@ | ||
apiVersion: virtualization.deckhouse.io/v1alpha2 | ||
kind: VirtualDisk | ||
metadata: | ||
name: vd-blank | ||
spec: | ||
persistentVolumeClaim: | ||
size: 100Mi |
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 |
Oops, something went wrong.