Skip to content

Commit

Permalink
Add unit test for encrypted EBS volume-backed instance
Browse files Browse the repository at this point in the history
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: #22691
  • Loading branch information
aiyengar2 committed Feb 19, 2020
1 parent 53ef83d commit d839c09
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 v0.8.0
ENV CATTLE_ETCD_VERSION v3.3.14
ENV GO111MODULE off
Expand Down
2 changes: 1 addition & 1 deletion package/Dockerfile
Expand Up @@ -21,7 +21,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 v0.8.0
ENV CATTLE_MACHINE_VERSION v0.15.0-rancher29
ENV CATTLE_MACHINE_VERSION v0.15.0-rancher31
ENV CATTLE_ETCD_VERSION v3.3.14
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 @@ -193,6 +193,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 d839c09

Please sign in to comment.