Merge ~raharper/curtin:feature/support-uc20-images into curtin:master

Proposed by Ryan Harper
Status: Merged
Approved by: Ryan Harper
Approved revision: c96a736d2cf5c02a8149dd6cd0e83bb5a431fef5
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~raharper/curtin:feature/support-uc20-images
Merge into: curtin:master
Diff against target: 439 lines (+209/-22)
9 files modified
curtin/commands/block_meta.py (+8/-1)
curtin/commands/curthooks.py (+8/-3)
curtin/distro.py (+18/-1)
tests/unittests/test_commands_block_meta.py (+2/-2)
tests/unittests/test_curthooks.py (+74/-5)
tests/unittests/test_distro.py (+51/-2)
tests/vmtests/__init__.py (+21/-6)
tests/vmtests/releases.py (+18/-2)
tests/vmtests/test_ubuntu_core.py (+9/-0)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Chad Smith Approve
Review via email: mp+380552@code.launchpad.net

Commit message

Add support for installing Ubuntu Core 20 images

Update detection methods for Ubuntu Core 20. Use new agreed upon location
for writing out cloud.cfg.d directory with contents provided from MAAS.
Add vmtest coverage for UC20 image as well.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:5e3715d5ddaddd02fe85cab0b594aa3d1ac13ce6
https://jenkins.ubuntu.com/server/job/curtin-ci/12/
Executed test runs:
    None: https://jenkins.ubuntu.com/server/job/admin-lp-git-vote/2091/

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/curtin-ci/12//rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
087aaf8... by Ryan Harper

uc20: update location to write cloud-config

https://github.com/snapcore/snapd/pull/8299

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Chad Smith (chad.smith) wrote :

Thanks for this Ryan.

To refresh context on integration testing uc20 and debugging, can you specify the one-liner vmtest run you can perform to beat that into my head.

Revision history for this message
Ryan Harper (raharper) wrote :

Since the images are not published under images.maas.io we have hack we employ on diglett where I've manually downloaded a UC20 image, unpacked it and created the directory paths that published images would, and in this MR, the path is hard-coded.

rm -rf output; IMAGE_DIR=/srv/tmp/rharper/images CURTIN_VMTEST_KEEP_DATA_FAIL=all ./tools/jenkins-runner tests/vmtests/test_ubuntu_core.py:UbuntuCore20TestUbuntuCore

Thanks for the review. I'll update with some changes.

5f2cd54... by Ryan Harper

block-meta: add documentation on paths used with block.get_root_device()

bf7ac11... by Ryan Harper

curthooks: fix typo in ubuntu_core_curthooks comment.

36cbfad... by Ryan Harper

Update core16/core18 docstrings to mention their specific version

27fb624... by Ryan Harper

Rename mock variable to indicate its use

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Chad Smith (chad.smith) wrote :

Thanks for the comments and clarifications here. LGTM

review: Approve
c96a736... by Ryan Harper

Don't enable the vmtest by default, images are not published

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/curtin/commands/block_meta.py b/curtin/commands/block_meta.py
index b0dcb81..6c6bfc7 100644
--- a/curtin/commands/block_meta.py
+++ b/curtin/commands/block_meta.py
@@ -135,7 +135,14 @@ def write_image_to_disk(source, dev):
135 '--', source['uri'], devnode])135 '--', source['uri'], devnode])
136 util.subp(['partprobe', devnode])136 util.subp(['partprobe', devnode])
137 udevadm_settle()137 udevadm_settle()
138 paths = ["curtin", "system-data/var/lib/snapd"]138 # Images from MAAS have well-known/required paths present
139 # on the rootfs partition. Use these values to select the
140 # root (target) partition to complete installation.
141 #
142 # /curtin -> Most Ubuntu Images
143 # /system-data/var/lib/snapd -> UbuntuCore 16 or 18
144 # /snaps -> UbuntuCore20
145 paths = ["curtin", "system-data/var/lib/snapd", "snaps"]
139 return block.get_root_device([devname], paths=paths)146 return block.get_root_device([devname], paths=paths)
140147
141148
diff --git a/curtin/commands/curthooks.py b/curtin/commands/curthooks.py
index 3c5d38f..ad90fa1 100644
--- a/curtin/commands/curthooks.py
+++ b/curtin/commands/curthooks.py
@@ -1264,13 +1264,18 @@ def handle_cloudconfig(cfg, base_dir=None):
12641264
12651265
1266def ubuntu_core_curthooks(cfg, target=None):1266def ubuntu_core_curthooks(cfg, target=None):
1267 """ Ubuntu-Core 16 images cannot execute standard curthooks1267 """ Ubuntu-Core images cannot execute standard curthooks.
1268 Instead we copy in any cloud-init configuration to1268 Instead, for core16/18 we copy in any cloud-init configuration to
1269 the 'LABEL=writable' partition mounted at target.1269 the 'LABEL=writable' partition mounted at target. For core20, we
1270 write a cloud-config.d directory in the 'ubuntu-seed' location.
1270 """1271 """
12711272
1272 ubuntu_core_target = os.path.join(target, "system-data")1273 ubuntu_core_target = os.path.join(target, "system-data")
1273 cc_target = os.path.join(ubuntu_core_target, 'etc/cloud/cloud.cfg.d')1274 cc_target = os.path.join(ubuntu_core_target, 'etc/cloud/cloud.cfg.d')
1275 if not os.path.exists(ubuntu_core_target): # uc20
1276 ubuntu_core_target = target
1277 cc_target = os.path.join(ubuntu_core_target, 'data', 'etc',
1278 'cloud', 'cloud.cfg.d')
12741279
1275 cloudconfig = cfg.get('cloudconfig', None)1280 cloudconfig = cfg.get('cloudconfig', None)
1276 if cloudconfig:1281 if cloudconfig:
diff --git a/curtin/distro.py b/curtin/distro.py
index ed178bd..1f62e7a 100644
--- a/curtin/distro.py
+++ b/curtin/distro.py
@@ -131,10 +131,27 @@ def get_osfamily(target=None):
131131
132132
133def is_ubuntu_core(target=None):133def is_ubuntu_core(target=None):
134 """Check if Ubuntu-Core specific directory is present at target"""134 """Check if any Ubuntu-Core specific directory is present at target"""
135 return any([is_ubuntu_core_16(target),
136 is_ubuntu_core_18(target),
137 is_ubuntu_core_20(target)])
138
139
140def is_ubuntu_core_16(target=None):
141 """Check if Ubuntu-Core 16 specific directory is present at target"""
135 return os.path.exists(target_path(target, 'system-data/var/lib/snapd'))142 return os.path.exists(target_path(target, 'system-data/var/lib/snapd'))
136143
137144
145def is_ubuntu_core_18(target=None):
146 """Check if Ubuntu-Core 18 specific directory is present at target"""
147 return is_ubuntu_core_16(target)
148
149
150def is_ubuntu_core_20(target=None):
151 """Check if Ubuntu-Core 20 specific directory is present at target"""
152 return os.path.exists(target_path(target, 'snaps'))
153
154
138def is_centos(target=None):155def is_centos(target=None):
139 """Check if CentOS specific file is present at target"""156 """Check if CentOS specific file is present at target"""
140 return os.path.exists(target_path(target, 'etc/centos-release'))157 return os.path.exists(target_path(target, 'etc/centos-release'))
diff --git a/tests/unittests/test_commands_block_meta.py b/tests/unittests/test_commands_block_meta.py
index d7715c0..231b2d1 100644
--- a/tests/unittests/test_commands_block_meta.py
+++ b/tests/unittests/test_commands_block_meta.py
@@ -148,7 +148,7 @@ class TestBlockMetaSimple(CiTestCase):
148 self.mock_subp.assert_has_calls([call(args=wget),148 self.mock_subp.assert_has_calls([call(args=wget),
149 call(['partprobe', devnode]),149 call(['partprobe', devnode]),
150 call(['udevadm', 'settle'])])150 call(['udevadm', 'settle'])])
151 paths = ["curtin", "system-data/var/lib/snapd"]151 paths = ["curtin", "system-data/var/lib/snapd", "snaps"]
152 self.mock_block_get_root_device.assert_called_with([devname],152 self.mock_block_get_root_device.assert_called_with([devname],
153 paths=paths)153 paths=paths)
154154
@@ -171,7 +171,7 @@ class TestBlockMetaSimple(CiTestCase):
171 self.mock_subp.assert_has_calls([call(args=wget),171 self.mock_subp.assert_has_calls([call(args=wget),
172 call(['partprobe', devnode]),172 call(['partprobe', devnode]),
173 call(['udevadm', 'settle'])])173 call(['udevadm', 'settle'])])
174 paths = ["curtin", "system-data/var/lib/snapd"]174 paths = ["curtin", "system-data/var/lib/snapd", "snaps"]
175 self.mock_block_get_root_device.assert_called_with([devname],175 self.mock_block_get_root_device.assert_called_with([devname],
176 paths=paths)176 paths=paths)
177177
diff --git a/tests/unittests/test_curthooks.py b/tests/unittests/test_curthooks.py
index 72bb24e..5bc4bc0 100644
--- a/tests/unittests/test_curthooks.py
+++ b/tests/unittests/test_curthooks.py
@@ -879,14 +879,31 @@ class TestUefiRemoveDuplicateEntries(CiTestCase):
879879
880880
881class TestUbuntuCoreHooks(CiTestCase):881class TestUbuntuCoreHooks(CiTestCase):
882
883 def _make_uc16(self, target):
884 ucpath = os.path.join(target, 'system-data', 'var/lib/snapd')
885 util.ensure_dir(ucpath)
886 return ucpath
887
888 def _make_uc20(self, target):
889 ucpath = os.path.join(target, 'snaps')
890 util.ensure_dir(ucpath)
891 return ucpath
892
882 def setUp(self):893 def setUp(self):
883 super(TestUbuntuCoreHooks, self).setUp()894 super(TestUbuntuCoreHooks, self).setUp()
884 self.target = None895 self.target = None
885896
886 def test_target_is_ubuntu_core(self):897 def test_target_is_ubuntu_core_16(self):
898 self.target = self.tmp_dir()
899 ubuntu_core_path = self._make_uc16(self.target)
900 self.assertTrue(os.path.isdir(ubuntu_core_path))
901 is_core = distro.is_ubuntu_core(self.target)
902 self.assertTrue(is_core)
903
904 def test_target_is_ubuntu_core_20(self):
887 self.target = self.tmp_dir()905 self.target = self.tmp_dir()
888 ubuntu_core_path = os.path.join(self.target, 'system-data',906 ubuntu_core_path = self._make_uc20(self.target)
889 'var/lib/snapd')
890 util.ensure_dir(ubuntu_core_path)907 util.ensure_dir(ubuntu_core_path)
891 self.assertTrue(os.path.isdir(ubuntu_core_path))908 self.assertTrue(os.path.isdir(ubuntu_core_path))
892 is_core = distro.is_ubuntu_core(self.target)909 is_core = distro.is_ubuntu_core(self.target)
@@ -952,6 +969,8 @@ class TestUbuntuCoreHooks(CiTestCase):
952 }969 }
953 }970 }
954 }971 }
972 uc_cloud = os.path.join(self.target, 'system-data')
973 util.ensure_dir(uc_cloud)
955 curthooks.ubuntu_core_curthooks(cfg, target=self.target)974 curthooks.ubuntu_core_curthooks(cfg, target=self.target)
956975
957 self.assertEqual(len(mock_del_file.call_args_list), 0)976 self.assertEqual(len(mock_del_file.call_args_list), 0)
@@ -964,9 +983,32 @@ class TestUbuntuCoreHooks(CiTestCase):
964 @patch('curtin.util.write_file')983 @patch('curtin.util.write_file')
965 @patch('curtin.util.del_file')984 @patch('curtin.util.del_file')
966 @patch('curtin.commands.curthooks.handle_cloudconfig')985 @patch('curtin.commands.curthooks.handle_cloudconfig')
986 def test_curthooks_uc20_cloud_config(self, mock_handle_cc, mock_del_file,
987 mock_write_file):
988 self.target = self.tmp_dir()
989 self._make_uc20(self.target)
990 cfg = {
991 'cloudconfig': {
992 'file1': {
993 'content': "Hello World!\n",
994 }
995 }
996 }
997 curthooks.ubuntu_core_curthooks(cfg, target=self.target)
998 self.assertEqual(len(mock_del_file.call_args_list), 0)
999 cc_path = os.path.join(self.target,
1000 'data', 'etc', 'cloud', 'cloud.cfg.d')
1001 mock_handle_cc.assert_called_with(cfg.get('cloudconfig'),
1002 base_dir=cc_path)
1003 self.assertEqual(len(mock_write_file.call_args_list), 0)
1004
1005 @patch('curtin.util.write_file')
1006 @patch('curtin.util.del_file')
1007 @patch('curtin.commands.curthooks.handle_cloudconfig')
967 def test_curthooks_net_config(self, mock_handle_cc, mock_del_file,1008 def test_curthooks_net_config(self, mock_handle_cc, mock_del_file,
968 mock_write_file):1009 mock_write_file):
969 self.target = self.tmp_dir()1010 self.target = self.tmp_dir()
1011 self._make_uc16(self.target)
970 cfg = {1012 cfg = {
971 'network': {1013 'network': {
972 'version': '1',1014 'version': '1',
@@ -974,12 +1016,12 @@ class TestUbuntuCoreHooks(CiTestCase):
974 'name': 'eth0', 'subnets': [{'type': 'dhcp4'}]}]1016 'name': 'eth0', 'subnets': [{'type': 'dhcp4'}]}]
975 }1017 }
976 }1018 }
1019 uc_cloud = os.path.join(self.target, 'system-data')
977 curthooks.ubuntu_core_curthooks(cfg, target=self.target)1020 curthooks.ubuntu_core_curthooks(cfg, target=self.target)
9781021
979 self.assertEqual(len(mock_del_file.call_args_list), 0)1022 self.assertEqual(len(mock_del_file.call_args_list), 0)
980 self.assertEqual(len(mock_handle_cc.call_args_list), 0)1023 self.assertEqual(len(mock_handle_cc.call_args_list), 0)
981 netcfg_path = os.path.join(self.target,1024 netcfg_path = os.path.join(uc_cloud,
982 'system-data',
983 'etc/cloud/cloud.cfg.d',1025 'etc/cloud/cloud.cfg.d',
984 '50-curtin-networking.cfg')1026 '50-curtin-networking.cfg')
985 netcfg = config.dump_config({'network': cfg.get('network')})1027 netcfg = config.dump_config({'network': cfg.get('network')})
@@ -987,6 +1029,33 @@ class TestUbuntuCoreHooks(CiTestCase):
987 content=netcfg)1029 content=netcfg)
988 self.assertEqual(len(mock_del_file.call_args_list), 0)1030 self.assertEqual(len(mock_del_file.call_args_list), 0)
9891031
1032 @patch('curtin.util.write_file')
1033 @patch('curtin.util.del_file')
1034 @patch('curtin.commands.curthooks.handle_cloudconfig')
1035 def test_curthooks_uc20_net_config(self, mock_handle_cc, mock_del_file,
1036 mock_write_file):
1037 self.target = self.tmp_dir()
1038 self._make_uc20(self.target)
1039 cfg = {
1040 'network': {
1041 'version': '1',
1042 'config': [{'type': 'physical',
1043 'name': 'eth0', 'subnets': [{'type': 'dhcp4'}]}]
1044 }
1045 }
1046 uc_cloud = os.path.join(self.target,
1047 'data', 'etc', 'cloud', 'cloud.cfg.d')
1048 curthooks.ubuntu_core_curthooks(cfg, target=self.target)
1049
1050 self.assertEqual(len(mock_del_file.call_args_list), 0)
1051 self.assertEqual(len(mock_handle_cc.call_args_list), 0)
1052 netcfg_path = os.path.join(uc_cloud,
1053 '50-curtin-networking.cfg')
1054 netcfg = config.dump_config({'network': cfg.get('network')})
1055 mock_write_file.assert_called_with(netcfg_path,
1056 content=netcfg)
1057 self.assertEqual(len(mock_del_file.call_args_list), 0)
1058
990 @patch('curtin.commands.curthooks.futil.write_files')1059 @patch('curtin.commands.curthooks.futil.write_files')
991 def test_handle_cloudconfig(self, mock_write_files):1060 def test_handle_cloudconfig(self, mock_write_files):
992 cc_target = "tmpXXXX/systemd-data/etc/cloud/cloud.cfg.d"1061 cc_target = "tmpXXXX/systemd-data/etc/cloud/cloud.cfg.d"
diff --git a/tests/unittests/test_distro.py b/tests/unittests/test_distro.py
index dc1038c..c994963 100644
--- a/tests/unittests/test_distro.py
+++ b/tests/unittests/test_distro.py
@@ -193,16 +193,65 @@ class TestDistroInfo(CiTestCase):
193193
194class TestDistroIdentity(CiTestCase):194class TestDistroIdentity(CiTestCase):
195195
196 ubuntu_core_os_path_side_effects = [
197 [True, True, True],
198 [True, True, False],
199 [True, False, True],
200 [True, False, False],
201 [False, True, True],
202 [False, True, False],
203 [False, False, True],
204 ]
205
196 def setUp(self):206 def setUp(self):
197 super(TestDistroIdentity, self).setUp()207 super(TestDistroIdentity, self).setUp()
198 self.add_patch('curtin.distro.os.path.exists', 'mock_os_path')208 self.add_patch('curtin.distro.os.path.exists', 'mock_os_path')
199209
200 def test_is_ubuntu_core(self):210 def test_is_ubuntu_core_16(self):
201 for exists in [True, False]:211 for exists in [True, False]:
202 self.mock_os_path.return_value = exists212 self.mock_os_path.return_value = exists
203 self.assertEqual(exists, distro.is_ubuntu_core())213 self.assertEqual(exists, distro.is_ubuntu_core_16())
204 self.mock_os_path.assert_called_with('/system-data/var/lib/snapd')214 self.mock_os_path.assert_called_with('/system-data/var/lib/snapd')
205215
216 def test_is_ubuntu_core_18(self):
217 for exists in [True, False]:
218 self.mock_os_path.return_value = exists
219 self.assertEqual(exists, distro.is_ubuntu_core_18())
220 self.mock_os_path.assert_called_with('/system-data/var/lib/snapd')
221
222 def test_is_ubuntu_core_is_core20(self):
223 for exists in [True, False]:
224 self.mock_os_path.return_value = exists
225 self.assertEqual(exists, distro.is_ubuntu_core_20())
226 self.mock_os_path.assert_called_with('/snaps')
227
228 def test_is_ubuntu_core_true(self):
229 side_effects = self.ubuntu_core_os_path_side_effects
230 for true_effect in side_effects:
231 self.mock_os_path.side_effect = iter(true_effect)
232 self.assertTrue(distro.is_ubuntu_core())
233
234 expected_calls = [
235 mock.call('/system-data/var/lib/snapd'),
236 mock.call('/system-data/var/lib/snapd'),
237 mock.call('/snaps')]
238 expected_nr_calls = len(side_effects) * len(expected_calls)
239 self.assertEqual(expected_nr_calls, self.mock_os_path.call_count)
240 self.mock_os_path.assert_has_calls(
241 expected_calls * len(side_effects))
242
243 def test_is_ubuntu_core_false(self):
244 self.mock_os_path.return_value = False
245 self.assertFalse(distro.is_ubuntu_core())
246
247 expected_calls = [
248 mock.call('/system-data/var/lib/snapd'),
249 mock.call('/system-data/var/lib/snapd'),
250 mock.call('/snaps')]
251 expected_nr_calls = 3
252 self.assertEqual(expected_nr_calls, self.mock_os_path.call_count)
253 self.mock_os_path.assert_has_calls(expected_calls)
254
206 def test_is_centos(self):255 def test_is_centos(self):
207 for exists in [True, False]:256 for exists in [True, False]:
208 self.mock_os_path.return_value = exists257 self.mock_os_path.return_value = exists
diff --git a/tests/vmtests/__init__.py b/tests/vmtests/__init__.py
index b87784b..06b1b48 100644
--- a/tests/vmtests/__init__.py
+++ b/tests/vmtests/__init__.py
@@ -66,6 +66,8 @@ _TOPDIR = None
6666
67UC16_IMAGE = os.path.join(IMAGE_DIR,67UC16_IMAGE = os.path.join(IMAGE_DIR,
68 'ubuntu-core-16/amd64/20170217/root-image.xz')68 'ubuntu-core-16/amd64/20170217/root-image.xz')
69UC20_IMAGE = os.path.join(IMAGE_DIR, ('ubuntu-core-20/amd64/20200304/'
70 'ubuntu-core-20-amd64.img.xz'))
6971
7072
71def remove_empty_dir(dirpath):73def remove_empty_dir(dirpath):
@@ -670,9 +672,16 @@ class VMBaseClass(TestCase):
670672
671 tftype = cls.target_ftype673 tftype = cls.target_ftype
672 if tftype in ["root-image.xz"]:674 if tftype in ["root-image.xz"]:
673 logger.info('get-testfiles UC16 hack!')675 logger.info('get-testfiles UC hack!')
674 target_ftypes = {'root-image.xz': UC16_IMAGE}676 if cls.target_release == 'ubuntu-core-16':
675 target_img_verstr = "UbuntuCore 16"677 target_ftypes = {'root-image.xz': UC16_IMAGE}
678 target_img_verstr = "UbuntuCore 16"
679 elif cls.target_release == 'ubuntu-core-20':
680 target_ftypes = {'root-image.xz': UC20_IMAGE}
681 target_img_verstr = "UbuntuCore 20"
682 else:
683 raise ValueError(
684 "Unknown target_release=%s" % cls.target_release)
676 elif cls.target_release == cls.release:685 elif cls.target_release == cls.release:
677 target_ftypes = ftypes.copy()686 target_ftypes = ftypes.copy()
678 target_img_verstr = eph_img_verstr687 target_img_verstr = eph_img_verstr
@@ -891,7 +900,7 @@ class VMBaseClass(TestCase):
891 if not cls.collect_scripts:900 if not cls.collect_scripts:
892 cls.collect_scripts = (901 cls.collect_scripts = (
893 DEFAULT_COLLECT_SCRIPTS['common'] +902 DEFAULT_COLLECT_SCRIPTS['common'] +
894 DEFAULT_COLLECT_SCRIPTS[cls.target_distro])903 DEFAULT_COLLECT_SCRIPTS.get(cls.target_distro, []))
895 else:904 else:
896 raise RuntimeError('cls collect scripts not empty: %s' %905 raise RuntimeError('cls collect scripts not empty: %s' %
897 cls.collect_scripts)906 cls.collect_scripts)
@@ -1077,7 +1086,10 @@ class VMBaseClass(TestCase):
1077 disks.extend(cls.build_iscsi_disks())1086 disks.extend(cls.build_iscsi_disks())
10781087
1079 # class config file and vmtest defaults1088 # class config file and vmtest defaults
1080 configs = [cls.conf_file, 'examples/tests/vmtest_defaults.yaml']1089 configs = [cls.conf_file]
1090 if cls.target_distro not in ['ubuntu-core']:
1091 configs.append('examples/tests/vmtest_defaults.yaml')
1092
1081 # proxy config1093 # proxy config
1082 cls.proxy = get_apt_proxy()1094 cls.proxy = get_apt_proxy()
1083 if cls.proxy is not None and not cls.td.restored:1095 if cls.proxy is not None and not cls.td.restored:
@@ -1927,7 +1939,10 @@ class VMBaseClass(TestCase):
19271939
1928 def has_storage_config(self):1940 def has_storage_config(self):
1929 '''check if test used storage config'''1941 '''check if test used storage config'''
1930 return len(self.get_storage_config()) > 01942 try:
1943 return len(self.get_storage_config()) > 0
1944 except FileNotFoundError:
1945 return False
19311946
1932 @skip_if_flag('expected_failure')1947 @skip_if_flag('expected_failure')
1933 def test_swaps_used(self):1948 def test_swaps_used(self):
diff --git a/tests/vmtests/releases.py b/tests/vmtests/releases.py
index bf8be2f..629b96e 100644
--- a/tests/vmtests/releases.py
+++ b/tests/vmtests/releases.py
@@ -26,7 +26,7 @@ class _CentosFromUbuntuBase(_UbuntuBase):
2626
27class _UbuntuCoreUbuntuBase(_UbuntuBase):27class _UbuntuCoreUbuntuBase(_UbuntuBase):
28 # base for installing UbuntuCore root-image.xz from ubuntu base28 # base for installing UbuntuCore root-image.xz from ubuntu base
29 target_distro = "ubuntu-core-16"29 target_distro = "ubuntu-core"
30 target_ftype = "root-image.xz"30 target_ftype = "root-image.xz"
31 kflavor = None31 kflavor = None
3232
@@ -57,7 +57,21 @@ class _UbuntuCore16FromXenialBase(_UbuntuCoreUbuntuBase):
57 release = "xenial"57 release = "xenial"
58 # release for target58 # release for target
59 target_release = "ubuntu-core-16"59 target_release = "ubuntu-core-16"
60 target_distro = "ubuntu-core"60
61
62class _UbuntuCore18FromBionicBase(_UbuntuCoreUbuntuBase):
63 # release for boot
64 release = "bionic"
65 # release for target
66 target_release = "ubuntu-core-18"
67
68
69class _UbuntuCore20FromFocalBase(_UbuntuCoreUbuntuBase):
70 # release for boot
71 release = "focal"
72 # release for target
73 target_release = "ubuntu-core-20"
74 mem = "2048"
6175
6276
63class _Centos66FromXenialBase(_CentosFromUbuntuBase):77class _Centos66FromXenialBase(_CentosFromUbuntuBase):
@@ -201,6 +215,8 @@ class _CentosReleases(object):
201215
202class _UbuntuCoreReleases(object):216class _UbuntuCoreReleases(object):
203 uc16fromxenial = _UbuntuCore16FromXenialBase217 uc16fromxenial = _UbuntuCore16FromXenialBase
218 uc18frombionic = _UbuntuCore18FromBionicBase
219 uc20fromfocal = _UbuntuCore20FromFocalBase
204220
205221
206base_vm_classes = _Releases222base_vm_classes = _Releases
diff --git a/tests/vmtests/test_ubuntu_core.py b/tests/vmtests/test_ubuntu_core.py
index a282940..bd62175 100644
--- a/tests/vmtests/test_ubuntu_core.py
+++ b/tests/vmtests/test_ubuntu_core.py
@@ -18,6 +18,7 @@ class TestUbuntuCoreAbs(VMBaseClass):
18 cp -a /etc/cloud ./etc_cloud |:18 cp -a /etc/cloud ./etc_cloud |:
19 cp -a /home . |:19 cp -a /home . |:
20 cp -a /var/lib/extrausers . |:20 cp -a /var/lib/extrausers . |:
21 find /boot > ./boot.files
2122
22 exit 023 exit 0
23 """)]24 """)]
@@ -44,4 +45,12 @@ class TestUbuntuCoreAbs(VMBaseClass):
44class UbuntuCore16TestUbuntuCore(relbase.uc16fromxenial, TestUbuntuCoreAbs):45class UbuntuCore16TestUbuntuCore(relbase.uc16fromxenial, TestUbuntuCoreAbs):
45 __test__ = False46 __test__ = False
4647
48
49class UbuntuCore20TestUbuntuCore(relbase.uc20fromfocal, TestUbuntuCoreAbs):
50 uefi = True
51 __test__ = False
52 mem = 2048
53 nr_cpus = 2
54
55
47# vi: ts=4 expandtab syntax=python56# vi: ts=4 expandtab syntax=python

Subscribers

People subscribed via source and target branches