diff options
author | sshedi <53473811+sshedi@users.noreply.github.com> | 2021-06-18 22:23:44 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-18 11:53:44 -0500 |
commit | 35aa9db6f8e2ba05d366776c0e8d97f52217e930 (patch) | |
tree | e3c14005ed078aea1cc0425ec8bea3db9f16602e /cloudinit/tests | |
parent | f5a244960c3f1591d022c081d816bc9604512629 (diff) | |
download | vyos-cloud-init-35aa9db6f8e2ba05d366776c0e8d97f52217e930.tar.gz vyos-cloud-init-35aa9db6f8e2ba05d366776c0e8d97f52217e930.zip |
Add support for VMware PhotonOS (#909)
Also added a new (currently experimental) systemd-networkd renderer,
and includes a small refactor to cc_resolv_conf.py to support the
resolved.conf used by systemd-resolved.
Diffstat (limited to 'cloudinit/tests')
-rw-r--r-- | cloudinit/tests/test_util.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cloudinit/tests/test_util.py b/cloudinit/tests/test_util.py index f9bc31be..a1ccb1dc 100644 --- a/cloudinit/tests/test_util.py +++ b/cloudinit/tests/test_util.py @@ -177,6 +177,17 @@ OS_RELEASE_UBUNTU = dedent("""\ UBUNTU_CODENAME=xenial\n """) +OS_RELEASE_PHOTON = ("""\ + NAME="VMware Photon OS" + VERSION="4.0" + ID=photon + VERSION_ID=4.0 + PRETTY_NAME="VMware Photon OS/Linux" + ANSI_COLOR="1;34" + HOME_URL="https://vmware.github.io/photon/" + BUG_REPORT_URL="https://github.com/vmware/photon/issues" +""") + class FakeCloud(object): @@ -609,6 +620,15 @@ class TestGetLinuxDistro(CiTestCase): self.assertEqual( ('opensuse-tumbleweed', '20180920', platform.machine()), dist) + @mock.patch('cloudinit.util.load_file') + def test_get_linux_photon_os_release(self, m_os_release, m_path_exists): + """Verify we get the correct name and machine arch on PhotonOS""" + m_os_release.return_value = OS_RELEASE_PHOTON + m_path_exists.side_effect = TestGetLinuxDistro.os_release_exists + dist = util.get_linux_distro() + self.assertEqual( + ('photon', '4.0', 'VMware Photon OS/Linux'), dist) + @mock.patch('platform.system') @mock.patch('platform.dist', create=True) def test_get_linux_distro_no_data(self, m_platform_dist, |