diff options
author | Shixin Ruan <matboy_80@aliyun.com> | 2019-09-18 13:15:25 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-09-18 13:15:25 +0000 |
commit | 571f7c36e89f67f4c2d1cacfd8f9269bf864d560 (patch) | |
tree | ca88604c5f74aef35455e250dc781a4c1fc62f5b /tests/unittests/test_ds_identify.py | |
parent | 4df0065998961ad21a9b733fb23ae2ebd78b7380 (diff) | |
download | vyos-cloud-init-571f7c36e89f67f4c2d1cacfd8f9269bf864d560.tar.gz vyos-cloud-init-571f7c36e89f67f4c2d1cacfd8f9269bf864d560.zip |
Add datasource for ZStack platform.
Zstack platform provides a AWS Ec2 metadata service, and
identifies their platform to the guest by setting the 'chassis asset tag'
to a string that ends with '.zstack.io'.
LP: #1841181
Diffstat (limited to 'tests/unittests/test_ds_identify.py')
-rw-r--r-- | tests/unittests/test_ds_identify.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/unittests/test_ds_identify.py b/tests/unittests/test_ds_identify.py index de87be29..7aeeb91c 100644 --- a/tests/unittests/test_ds_identify.py +++ b/tests/unittests/test_ds_identify.py @@ -609,6 +609,10 @@ class TestDsIdentify(DsIdentifyBase): self.assertEqual(expected, [p for p in expected if p in toks], "path did not have expected tokens") + def test_zstack_is_ec2(self): + """EC2: chassis asset tag ends with 'zstack.io'""" + self._test_ds_found('Ec2-ZStack') + class TestIsIBMProvisioning(DsIdentifyBase): """Test the is_ibm_provisioning method in ds-identify.""" @@ -971,8 +975,11 @@ VALID_CFG = { {'name': 'blkid', 'ret': 2, 'out': ''}, ], 'files': {ds_smartos.METADATA_SOCKFILE: 'would be a socket\n'}, + }, + 'Ec2-ZStack': { + 'ds': 'Ec2', + 'files': {P_CHASSIS_ASSET_TAG: '123456.zstack.io\n'}, } - } # vi: ts=4 expandtab |