Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add unit test for encrypted EBS volume-backed instance
This commit contains a unit test that ensures that the amazonec2 driver contains a flag for encrypting an EBS volume.

PR for this unit test: rancher/machine#63

Related Issue: rancher#22691
  • Loading branch information
aiyengar2 committed Feb 13, 2020
1 parent e01ea3a commit ff24cb9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.dapper
Expand Up @@ -4,7 +4,7 @@ FROM ubuntu:18.04
ARG DAPPER_HOST_ARCH
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
ENV CATTLE_HELM_VERSION v2.14.3-rancher1
ENV CATTLE_MACHINE_VERSION v0.15.0-rancher29
ENV CATTLE_MACHINE_VERSION v0.15.0-rancher31
ENV CATTLE_K3S_VERSION v1.17.2+k3s1
ENV CATTLE_ETCD_VERSION v3.4.3
ENV GO111MODULE off
Expand Down
2 changes: 1 addition & 1 deletion package/Dockerfile
Expand Up @@ -20,7 +20,7 @@ ARG RANCHER_METADATA_BRANCH=
ENV CATTLE_SYSTEM_CHART_DEFAULT_BRANCH=$SYSTEM_CHART_DEFAULT_BRANCH
ENV CATTLE_HELM_VERSION v2.14.3-rancher1
ENV CATTLE_K3S_VERSION v1.17.2+k3s1
ENV CATTLE_MACHINE_VERSION v0.15.0-rancher29
ENV CATTLE_MACHINE_VERSION v0.15.0-rancher31
ENV CATTLE_ETCD_VERSION v3.4.3
ENV LOGLEVEL_VERSION v0.1.2
ENV TINI_VERSION v0.18.0
Expand Down
10 changes: 10 additions & 0 deletions tests/integration/suite/test_node.py
Expand Up @@ -191,6 +191,16 @@ def test_node_driver_schema(admin_mc):
'Driver {} has field {}'.format(driver, field)


def test_amazon_node_driver_schema(admin_mc):
"""Test amazon node driver schema supports AWS-specific resource fields"""
required_fields = ['encryptEbsVolume']
client = admin_mc.client
schema = client.schema.types['amazonec2config']
for field in required_fields:
assert field in schema.resourceFields, \
'amazonec2config missing support for field {}'.format(field)


def create_node_template(client):
cloud_credential = client.create_cloud_credential(
azurecredentialConfig={"clientId": "test",
Expand Down

0 comments on commit ff24cb9

Please sign in to comment.