~xubuntu-dev/ubuntu-cdimage/xubuntu-base

« back to all changes in this revision

Viewing changes to lib/cdimage/tests/test_livefs.py

  • Committer: Sean Davis
  • Date: 2018-03-28 10:32:07 UTC
  • mfrom: (1559.1.156 ubuntu-cdimage)
  • Revision ID: smd.seandavis@gmail.com-20180328103207-o6s9d6h0hxxh8eqc
Merge lp:ubuntu-cdimage rev 1715

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
    def test_project_tocd3_1(self):
177
177
        self.assertProjectEqual("tocd", "tocd3.1", "breezy")
178
178
 
 
179
    def test_project_ubuntu_touch_custom(self):
 
180
        self.assertProjectEqual("ubuntu-touch", "ubuntu-touch-custom", "vivid")
 
181
 
179
182
    def test_ubuntu_dvd(self):
180
183
        for series in all_series[:7]:
181
184
            self.assertProjectEqual(
351
354
        self.assertEqual(
352
355
            ["-f", "plain"], live_build_options(self.config, "i386"))
353
356
 
 
357
    def test_ubuntu_base(self):
 
358
        self.config["PROJECT"] = "ubuntu-base"
 
359
        self.assertEqual(
 
360
            ["-f", "plain"], live_build_options(self.config, "i386"))
 
361
 
354
362
    def test_ubuntu_touch(self):
355
363
        self.config["PROJECT"] = "ubuntu-touch"
356
364
        self.assertEqual(
357
365
            ["-f", "plain"], live_build_options(self.config, "armhf"))
358
366
 
359
 
    def test_ubuntu_pd(self):
360
 
        self.config["PROJECT"] = "ubuntu-pd"
 
367
    def test_ubuntu_touch_custom(self):
 
368
        self.config["PROJECT"] = "ubuntu-touch-custom"
361
369
        self.assertEqual(
362
370
            ["-f", "plain"], live_build_options(self.config, "armhf"))
363
371
 
935
943
        for series in all_series[:15]:
936
944
            self.assertFlavoursEqual(
937
945
                "powerpc powerpc64-smp", "powerpc", "ubuntu", series)
938
 
        for series in all_series[15:]:
 
946
        for series in all_series[15:24]:
939
947
            self.assertFlavoursEqual(
940
948
                "powerpc-smp powerpc64-smp", "powerpc", "ubuntu", series)
 
949
        for series in all_series[24:]:
 
950
            self.assertFlavoursEqual(
 
951
                "powerpc-smp generic", "powerpc", "ubuntu", series)
941
952
        self.assertFlavoursEqual("cell", "powerpc+ps3", "ubuntu", "gutsy")
942
953
        for series in all_series[7:15]:
943
954
            self.assertFlavoursEqual(
991
1002
    def test_desktop_items(self):
992
1003
        for item in (
993
1004
            "cloop", "squashfs", "manifest", "manifest-desktop",
994
 
            "manifest-remove", "size", "ext2", "ext3", "ext4", "rootfs.tar.gz",
995
 
            "custom.tar.gz", "tar.xz", "iso", "device.tar.gz",
996
 
            "azure.device.tar.gz", "plano.device.tar.gz",
 
1005
            "manifest-remove", "manifest-minimal-remove", "size", "ext2",
 
1006
            "ext3", "ext4", "rootfs.tar.gz", "custom.tar.gz", "tar.xz", "iso",
 
1007
            "device.tar.gz", "azure.device.tar.gz", "plano.device.tar.gz",
997
1008
            "raspi2.device.tar.gz",
998
1009
        ):
999
1010
            self.assertPathsEqual(
1005
1016
                 "current/livecd.ubuntu-ps3.%s" % item],
1006
1017
                "powerpc+ps3", item, "ubuntu", "hardy")
1007
1018
 
 
1019
    def test_imgxz(self):
 
1020
        for item in ("img.xz", "model-assertion"):
 
1021
            self.assertPathsEqual(
 
1022
                ["http://kapok.buildd/~buildd/LiveCD/artful/ubuntu-core/"
 
1023
                 "current/livecd.ubuntu-core.%s" % item],
 
1024
                "amd64", item, "ubuntu-core", "artful")
 
1025
            self.assertPathsEqual(
 
1026
                ["http://kishi00.buildd/~buildd/LiveCD/artful/"
 
1027
                 "ubuntu-core-raspi2/current/"
 
1028
                 "livecd.ubuntu-core-raspi2.%s" % item],
 
1029
                "armhf+raspi2", item, "ubuntu-core", "artful")
 
1030
 
1008
1031
    def test_kernel_items(self):
1009
1032
        for item in ("kernel", "initrd", "bootimg"):
1010
1033
            root = "http://kapok.buildd/~buildd/LiveCD/precise/kubuntu/current"
1146
1169
        ])
1147
1170
 
1148
1171
    @mock.patch("cdimage.osextras.fetch")
 
1172
    def test_download_live_items_diskimg(self, mock_fetch):
 
1173
        self.config["PROJECT"] = "ubuntu-server"
 
1174
        self.config["DIST"] = "xenial"
 
1175
        self.config["IMAGE_TYPE"] = "daily-preinstalled"
 
1176
        self.assertTrue(download_live_items(self.config, "armhf+raspi2",
 
1177
                                            "disk1.img.xz"))
 
1178
        mock_fetch.assert_called_once_with(
 
1179
            self.config,
 
1180
            "http://kishi00.buildd/~buildd/LiveCD/xenial/ubuntu-cpc-raspi2"
 
1181
            "/current/livecd.ubuntu-cpc.disk1.img.xz",
 
1182
            os.path.join(
 
1183
                self.temp_dir, "scratch", "ubuntu-server", "xenial",
 
1184
                "daily-preinstalled", "live", "armhf+raspi2.disk1.img.xz"))
 
1185
 
 
1186
    @mock.patch("cdimage.osextras.fetch")
 
1187
    def test_download_live_items_xzimg(self, mock_fetch):
 
1188
        self.config["PROJECT"] = "ubuntu-core"
 
1189
        self.config["DIST"] = "xenial"
 
1190
        self.config["IMAGE_TYPE"] = "daily-live"
 
1191
        self.assertTrue(download_live_items(self.config, "armhf+raspi3",
 
1192
                                            "img.xz"))
 
1193
        mock_fetch.assert_called_once_with(
 
1194
            self.config,
 
1195
            "http://kishi00.buildd/~buildd/LiveCD/xenial/ubuntu-core-raspi3"
 
1196
            "/current/livecd.ubuntu-core-raspi3.img.xz",
 
1197
            os.path.join(
 
1198
                self.temp_dir, "scratch", "ubuntu-core", "xenial",
 
1199
                "daily-live", "live", "armhf+raspi3.img.xz"))
 
1200
 
 
1201
    @mock.patch("cdimage.osextras.fetch")
1149
1202
    def test_download_live_items_initrd(self, mock_fetch):
1150
1203
        self.config["PROJECT"] = "ubuntu"
1151
1204
        self.config["DIST"] = "raring"
1267
1320
        mock_fetch.assert_called_once_with(
1268
1321
            self.config, url, os.path.join(target_dir, "i386.server-squashfs"))
1269
1322
 
 
1323
    @mock.patch("cdimage.osextras.fetch")
 
1324
    def test_download_live_items_installer_squashfs(self, mock_fetch):
 
1325
        self.config["PROJECT"] = "ubuntu-server"
 
1326
        self.config["SUBPROJECT"] = "live"
 
1327
        self.config["DIST"] = "xenial"
 
1328
        self.config["IMAGE_TYPE"] = "daily-live"
 
1329
        self.assertTrue(
 
1330
            download_live_items(self.config, "amd64", "installer.squashfs"))
 
1331
        url = ("http://kapok.buildd/~buildd/LiveCD/xenial/ubuntu-server-live/"
 
1332
               "current/livecd.ubuntu-server.installer.squashfs")
 
1333
        target_dir = os.path.join(
 
1334
            self.temp_dir, "scratch", "ubuntu-server", "xenial", "daily-live",
 
1335
            "live")
 
1336
        mock_fetch.assert_called_once_with(
 
1337
            self.config, url, os.path.join(target_dir,
 
1338
                                           "amd64.installer.squashfs"))
 
1339
 
1270
1340
    def test_write_autorun(self):
1271
1341
        self.config["PROJECT"] = "ubuntu"
1272
1342
        self.config["DIST"] = "raring"
1296
1366
            tail = os.path.basename(target).split(".", 1)[1]
1297
1367
            if tail in (
1298
1368
                "squashfs", "kernel-generic", "kernel-generic.efi.signed",
1299
 
                "initrd-generic", "manifest", "manifest-remove", "size",
1300
 
                "wubi.exe",
 
1369
                "initrd-generic", "manifest", "manifest-remove",
 
1370
                "manifest-minimal-remove", "size", "wubi.exe",
1301
1371
            ):
1302
1372
                touch(target)
1303
1373
            else:
1319
1389
            "amd64.kernel-generic.efi.signed",
1320
1390
            "amd64.manifest",
1321
1391
            "amd64.manifest-remove",
 
1392
            "amd64.manifest-minimal-remove",
1322
1393
            "amd64.size",
1323
1394
            "amd64.squashfs",
1324
1395
            "amd64.wubi.exe",
1327
1398
            "i386.kernel-generic",
1328
1399
            "i386.manifest",
1329
1400
            "i386.manifest-remove",
 
1401
            "i386.manifest-minimal-remove",
1330
1402
            "i386.size",
1331
1403
            "i386.squashfs",
1332
1404
            "i386.wubi.exe",