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

« back to all changes in this revision

Viewing changes to lib/cdimage/tests/test_tree.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:
168
168
            self.temp_dir, "production", "current-triggers")
169
169
        with mkfile(current_triggers_path) as current_triggers:
170
170
            print(
171
 
                "ubuntu\tdaily-live\t%s\ti386" % series, file=current_triggers)
 
171
                "ubuntu\tdaily-live\tprecise-\ti386", file=current_triggers)
172
172
        self.config["SSH_ORIGINAL_COMMAND"] = (
173
173
            "mark-current --project=ubuntu --series=%s --publish-type=desktop "
174
174
            "--architecture=i386 20130321" % series)
193
193
 
194
194
            with open(os.path.join(publish_base, "20130321", ".marked_good"),
195
195
                      "r") as marked_good:
196
 
                self.assertEqual("xenial-desktop-i386.iso\n",
 
196
                self.assertEqual("bionic-desktop-i386.iso\n",
197
197
                                 marked_good.read())
198
198
 
199
199
            publish_current = os.path.join(publish_base, "current")
253
253
             "preinstalled-headless"),
254
254
            ("daily-preinstalled", "ubuntu-server", "precise",
255
255
             "preinstalled-server"),
 
256
            ("daily-preinstalled", "ubuntu-server", "xenial",
 
257
             "preinstalled-server"),
256
258
            ("daily-preinstalled", "ubuntu", "precise",
257
259
             "preinstalled-desktop"),
258
260
            ("daily-preinstalled", "ubuntu-touch", "saucy",
259
261
             "preinstalled-touch"),
260
 
            ("daily-preinstalled", "ubuntu-pd", "vivid",
261
 
             "preinstalled-pd"),
 
262
            ("daily-preinstalled", "ubuntu-touch-custom", "vivid",
 
263
             "preinstalled-touch"),
262
264
            ("daily-live", "edubuntu", "edgy", "live"),
263
265
            ("daily-live", "edubuntu", "feisty", "desktop"),
264
266
            ("daily-live", "kubuntu-netbook", "lucid", "netbook"),
266
268
            ("daily-live", "ubuntu-mid", "lucid", "mid"),
267
269
            ("daily-live", "ubuntu-moblin-remix", "lucid", "moblin-remix"),
268
270
            ("daily-live", "ubuntu-netbook", "hardy", "netbook"),
269
 
            ("daily-live", "ubuntu-server", "hardy", "live"),
 
271
            ("daily-live", "ubuntu-server", "hardy", "live-server"),
270
272
            ("daily-live", "ubuntu", "breezy", "live"),
271
273
            ("daily-live", "ubuntu", "dapper", "desktop"),
272
274
            ("daily-live", "ubuntu-zh_CN", "raring", "desktop"),
 
275
            ("daily-live", "ubuntu-core", "xenial", "live-core"),
273
276
            ("ports_dvd", "ubuntu", "hardy", "dvd"),
274
277
            ("dvd", "kubuntu", "hardy", "dvd"),
275
278
            ("daily", "edubuntu", "edgy", "install"),
277
280
            ("daily", "edubuntu", "gutsy", "server"),
278
281
            ("daily", "edubuntu", "hardy", "addon"),
279
282
            ("daily", "jeos", "hardy", "jeos"),
280
 
            ("daily", "ubuntu-core", "precise", "core"),
 
283
            ("daily", "ubuntu-base", "precise", "base"),
281
284
            ("daily", "ubuntu-server", "breezy", "install"),
282
285
            ("daily", "ubuntu-server", "dapper", "server"),
283
286
            ("daily", "ubuntu", "breezy", "install"),
316
319
            ("kubuntu", ["http://releases.ubuntu.com/include/kubuntu.css"]),
317
320
            ("kubuntu-plasma5",
318
321
             ["http://releases.ubuntu.com/include/kubuntu-plasma5.css"]),
 
322
            ("lubuntu",
 
323
             ["http://cdimage.ubuntu.com/include/lubuntu/style.css"]),
 
324
            ("lubuntu-next",
 
325
             ["http://cdimage.ubuntu.com/include/lubuntu/style.css"]),
319
326
        ):
320
327
            self.config["PROJECT"] = project
321
328
            publisher = Publisher(self.tree, "daily")
378
385
            "For almost all PCs.  This includes most machines with "
379
386
            "Intel/AMD/etc type processors and almost all computers that run "
380
387
            "Microsoft Windows, as well as newer Apple Macintosh systems "
381
 
            "based on Intel processors.  Choose this if you are at all "
382
 
            "unsure.",
 
388
            "based on Intel processors.",
383
389
            publisher.archdesc("i386", "desktop"))
384
390
 
 
391
        self.assertEqual(
 
392
            "Choose this to take full advantage of computers based on the "
 
393
            "AMD64 or EM64T architecture (e.g., Athlon64, Opteron, EM64T "
 
394
            "Xeon, Core 2).  If you have a non-64-bit processor made by AMD, "
 
395
            "or if you need full support for 32-bit code, use the i386 images "
 
396
            "instead.  Choose this if you are at all unsure.",
 
397
            publisher.archdesc("amd64", "desktop"))
 
398
 
385
399
    def test_maybe_oversized(self):
386
400
        self.config["DIST"] = "precise"
387
401
        oversized_path = os.path.join(
526
540
                "IconWidth=22\n"
527
541
                "AddIcon ../../cdicons/folder.png ^^DIRECTORY^^\n"
528
542
                "AddIcon ../../cdicons/iso.png .iso\n"
529
 
                "AddIcon ../../cdicons/img.png .img .tar.gz .tar.xz\n"
 
543
                "AddIcon ../../cdicons/img.png .img .img.xz .tar.gz .tar.xz\n"
530
544
                "AddIcon ../../cdicons/jigdo.png .jigdo .template\n"
531
545
                "AddIcon ../../cdicons/list.png .list .manifest .html .zsync "
532
546
                "MD5SUMS MD5SUMS.gpg MD5SUMS-metalink MD5SUMS-metalink.gpg "
677
691
    def test_publish_base(self):
678
692
        self.assertEqual(
679
693
            os.path.join(
 
694
                self.config.root, "www", "full",
 
695
                "ubuntu-server", "daily-preinstalled"),
 
696
            self.make_publisher("ubuntu-server",
 
697
                                "daily-preinstalled").publish_base)
 
698
        self.assertEqual(
 
699
            os.path.join(
 
700
                self.config.root, "www", "full", "ubuntu-core",
 
701
                self.config.core_series, "edge"),
 
702
            self.make_publisher("ubuntu-core", "daily-live").publish_base)
 
703
        self.config["CHANNEL"] = 'stable'
 
704
        self.assertEqual(
 
705
            os.path.join(
 
706
                self.config.root, "www", "full", "ubuntu-core",
 
707
                self.config.core_series, "stable"),
 
708
            self.make_publisher("ubuntu-core", "daily-live").publish_base)
 
709
        self.assertEqual(
 
710
            os.path.join(
680
711
                self.config.root, "www", "full", "kubuntu", "daily-live"),
681
712
            self.make_publisher("kubuntu", "daily-live").publish_base)
682
713
        self.config["DIST"] = "hoary"
700
731
            ("ubuntustudio", None, "dvd", "i386", 4700372992),
701
732
            ("ubuntu-mid", None, "daily-live", "i386", 1073741824),
702
733
            ("ubuntu-moblin-remix", None, "daily-live", "i386", 1073741824),
703
 
            ("kubuntu", None, "daily-live", "i386", 1283457024),
704
 
            ("kubuntu-active", None, "daily-live", "i386", 1283457024),
705
 
            ("kubuntu-plasma5", None, "daily-live", "i386", 1283457024),
 
734
            ("kubuntu", "trusty", "daily-live", "i386", 1283457024),
 
735
            ("kubuntu", "xenial", "daily-live", "i386", 2000000000),
 
736
            ("kubuntu-active", "trusty", "daily-live", "i386", 1283457024),
 
737
            ("kubuntu-active", "xenial", "daily-live", "i386", 2000000000),
 
738
            ("kubuntu-plasma5", "trusty", "daily-live", "i386", 1283457024),
 
739
            ("kubuntu-plasma5", "xenial", "daily-live", "i386", 2000000000),
706
740
            ("ubuntu", None, "dvd", "i386", 4700372992),
707
741
            ("ubuntu", "precise", "daily-live", "i386", 736665600),
708
742
            ("ubuntu", "quantal", "daily-live", "i386", 801000000),
710
744
            ("ubuntu", "raring", "daily-live", "powerpc", 850000000),
711
745
            ("ubuntu", "saucy", "daily-live", "i386", 950000000),
712
746
            ("ubuntu", "saucy", "daily-live", "powerpc", 950000000),
713
 
            ("ubuntu", "trusty", "daily-live", "i386", 1073741824),
714
 
            ("ubuntu", "trusty", "daily-live", "powerpc", 1073741824),
 
747
            ("ubuntu", "trusty", "daily-live", "i386", 1200000000),
 
748
            ("ubuntu", "trusty", "daily-live", "powerpc", 1200000000),
 
749
            ("ubuntu", "xenial", "daily-live", "i386", 2000000000),
715
750
            ("xubuntu", "quantal", "daily-live", "i386", 736665600),
716
751
            ("xubuntu", "raring", "daily-live", "i386", 1073741824),
717
 
            ("xubuntu-base", None, "daily-live", "i386", 736665600),
 
752
            ("xubuntu", "xenial", "daily-live", "i386", 1460000000),
 
753
            ("xubuntu-base", "bionic", "daily-live", "i386", 736665600),
718
754
            ("ubuntu-gnome", "saucy", "daily-live", "i386", 1073741824),
719
 
            ("ubuntu-mate", None, "daily-live", "amd64", 1073741824),
 
755
            ("ubuntu-gnome", "xenial", "daily-live", "i386", 2000000000),
 
756
            ("ubuntu-budgie", "zesty", "daily-live", "i386", 2000000000),
 
757
            ("ubuntu-mate", "trusty", "daily-live", "amd64", 1073741824),
 
758
            ("ubuntu-mate", "xenial", "daily-live", "amd64", 2000000000),
 
759
            ("ubuntu-server", "xenial", "daily", "amd64", 1073741824),
 
760
            ("ubuntu-server", "zesty", "daily", "amd64", 736665600),
 
761
            ("ubuntu-server", "zesty", "daily", "ppc64el", 1073741824),
720
762
        ):
721
763
            if dist is not None:
722
764
                self.config["DIST"] = dist
865
907
                target_dir, "%s-desktop-i386.iso.zsync" % self.config.series),
866
908
            "%s-desktop-i386.iso" % self.config.series)
867
909
 
 
910
    @mock.patch("cdimage.osextras.find_on_path", return_value=True)
 
911
    @mock.patch("cdimage.tree.DailyTreePublisher.detect_image_extension",
 
912
                return_value="img.xz")
 
913
    @mock.patch("cdimage.tree.zsyncmake")
 
914
    def test_publish_core_binary(self, mock_zsyncmake, *args):
 
915
        self.config["DIST"] = "artful"
 
916
        publisher = self.make_publisher("ubuntu-core", "daily-live")
 
917
        source_dir = publisher.image_output("amd64")
 
918
        touch(os.path.join(
 
919
            source_dir, "%s-live-core-amd64.raw" % self.config.series))
 
920
        touch(os.path.join(
 
921
            source_dir,
 
922
            "%s-live-core-amd64.model-assertion" % self.config.series))
 
923
        self.capture_logging()
 
924
        list(publisher.publish_binary("live-core", "amd64", "20170429"))
 
925
        self.assertLogEqual([
 
926
            "Publishing amd64 ...",
 
927
            "Publishing amd64 model assertion ...",
 
928
            "Making amd64 zsync metafile ...",
 
929
        ])
 
930
        target_dir = os.path.join(publisher.publish_base, "20170429")
 
931
        self.assertEqual([], os.listdir(source_dir))
 
932
        self.assertCountEqual([
 
933
            "ubuntu-core-16-amd64.img.xz",
 
934
            "ubuntu-core-16-amd64.model-assertion",
 
935
        ], os.listdir(target_dir))
 
936
 
868
937
    def test_publish_livecd_base(self):
869
938
        publisher = self.make_publisher("livecd-base", "livecd-base")
870
939
        source_dir = os.path.join(
872
941
            "livecd-base", "live")
873
942
        for ext in (
874
943
            "squashfs", "kernel", "initrd", "manifest", "manifest-remove",
 
944
            "manifest-minimal-remove",
875
945
        ):
876
946
            touch(os.path.join(source_dir, "i386.%s" % ext))
877
947
        self.capture_logging()
883
953
        self.assertCountEqual([
884
954
            "i386.squashfs", "i386.kernel", "i386.initrd",
885
955
            "i386.manifest", "i386.manifest-remove",
 
956
            "i386.manifest-minimal-remove",
886
957
        ], os.listdir(target_dir))
887
958
 
888
959
    @mock.patch("cdimage.osextras.find_on_path", return_value=True)
958
1029
            set(["raring-desktop-amd64.iso", "raring-desktop-i386.iso"]),
959
1030
            publisher.published_images("20130321"))
960
1031
 
 
1032
    def test_published_core_images(self):
 
1033
        self.config["DIST"] = "xenial"
 
1034
        self.config["ARCHES"] = "amd64 i386"
 
1035
        publisher = self.make_publisher("ubuntu-core", "daily-live")
 
1036
        target_dir = os.path.join(publisher.publish_base, "20170429")
 
1037
        for name in (
 
1038
            "MD5SUMS",
 
1039
            "ubuntu-core-16-amd64.img.xz",
 
1040
            "ubuntu-core-16-amd64.model-assertion",
 
1041
            "ubuntu-core-16-i386.img.xz",
 
1042
            "ubuntu-core-16-i386.model-assertion",
 
1043
        ):
 
1044
            touch(os.path.join(target_dir, name))
 
1045
        self.assertEqual(
 
1046
            set(["ubuntu-core-16-amd64.img.xz", "ubuntu-core-16-i386.img.xz"]),
 
1047
            publisher.published_images("20170429"))
 
1048
 
961
1049
    @mock.patch("cdimage.tree.DailyTreePublisher.polish_directory")
962
1050
    def test_mark_current_missing_to_single(self, mock_polish_directory):
963
1051
        self.config["DIST"] = "raring"
1205
1293
            ("mythbuntu", "daily-live", "desktop", "Mythbuntu Desktop"),
1206
1294
            ("lubuntu", "daily", "alternate", "Lubuntu Alternate"),
1207
1295
            ("lubuntu", "daily-live", "desktop", "Lubuntu Desktop"),
1208
 
            ("ubuntu-core", "daily", "core", "Ubuntu Core"),
 
1296
            ("lubuntu-next", "daily-live", "desktop", "Lubuntu Next Desktop"),
 
1297
            ("ubuntu-base", "daily", "base", "Ubuntu Base"),
1209
1298
            ("ubuntukylin", "daily-live", "desktop", "Ubuntu Kylin Desktop"),
1210
1299
            ("ubuntu-gnome", "daily-live", "desktop", "Ubuntu GNOME Desktop"),
1211
 
            ("ubuntu-mate", "daily-live", "desktop", "Ubuntu Mate Desktop"),
 
1300
            ("ubuntu-budgie", "daily-live", "desktop",
 
1301
                "Ubuntu Budgie Desktop"),
 
1302
            ("ubuntu-mate", "daily-live", "desktop", "Ubuntu MATE Desktop"),
1212
1303
            ("ubuntu-desktop-next", "daily-preinstalled",
1213
1304
                "preinstalled-desktop-next", "Ubuntu Desktop (Unity 8)"),
1214
1305
        ):
1236
1327
                "ubuntu-touch", "daily-preinstalled", "preinstalled-touch",
1237
1328
                "armhf"))
1238
1329
 
 
1330
    def test_qa_product_ubuntu_touch_custom(self):
 
1331
        publisher = self.make_publisher(
 
1332
            "ubuntu-touch-custom", "daily-preinstalled")
 
1333
        self.assertEqual(
 
1334
            ("Ubuntu Touch Custom armhf", "iso"),
 
1335
            publisher.qa_product(
 
1336
                "ubuntu-touch-custom", "daily-preinstalled",
 
1337
                "preinstalled-touch", "armhf"))
 
1338
 
1239
1339
    def test_qa_product_ubuntu_preinstalled(self):
1240
1340
        publisher = self.make_publisher("ubuntu", "daily")
1241
1341
        self.assertEqual(
1267
1367
            ("mythbuntu", "daily-live", "desktop", "Mythbuntu Desktop"),
1268
1368
            ("lubuntu", "daily", "alternate", "Lubuntu Alternate"),
1269
1369
            ("lubuntu", "daily-live", "desktop", "Lubuntu Desktop"),
1270
 
            ("ubuntu-core", "daily", "core", "Ubuntu Core"),
 
1370
            ("lubuntu-next", "daily-live", "desktop", "Lubuntu Next Desktop"),
 
1371
            ("ubuntu-base", "daily", "base", "Ubuntu Base"),
1271
1372
            ("ubuntukylin", "daily-live", "desktop", "Ubuntu Kylin Desktop"),
1272
1373
            ("ubuntu-gnome", "daily-live", "desktop", "Ubuntu GNOME Desktop"),
1273
 
            ("ubuntu-mate", "daily-live", "desktop", "Ubuntu Mate Desktop"),
 
1374
            ("ubuntu-budgie", "daily-live", "desktop",
 
1375
                "Ubuntu Budgie Desktop"),
 
1376
            ("ubuntu-mate", "daily-live", "desktop", "Ubuntu MATE Desktop"),
1274
1377
            ("ubuntu-desktop-next/system-image", "daily-preinstalled",
1275
1378
                "preinstalled-desktop-next", "Ubuntu Desktop (Unity 8)"),
1276
1379
        ):
1690
1793
                target_dir, "%s-desktop-i386.iso.zsync" % self.config.series),
1691
1794
            "%s-desktop-i386.iso" % self.config.series)
1692
1795
 
 
1796
    def test_publish_core_binary(self):
 
1797
        pass
 
1798
 
1693
1799
    def test_publish_livecd_base(self):
1694
1800
        pass
1695
1801
 
1776
1882
        self.assertEqual(
1777
1883
            "/ports", self.tree.tree_suffix("ubuntu-server/ports/daily"))
1778
1884
        self.assertEqual("", self.tree.tree_suffix("ubuntu-server/daily"))
 
1885
        self.assertEqual(
 
1886
            "", self.tree.tree_suffix("ubuntu-server/daily-preinstalled"))
1779
1887
        self.assertEqual("/ports", self.tree.tree_suffix("ports/daily"))
1780
1888
        self.assertEqual("", self.tree.tree_suffix("daily"))
1781
1889
 
1797
1905
        self.assertEqual(
1798
1906
            "/ports", self.tree.tree_suffix("ubuntu-server/ports/daily"))
1799
1907
        self.assertEqual("", self.tree.tree_suffix("ubuntu-server/daily"))
 
1908
        self.assertEqual(
 
1909
            "", self.tree.tree_suffix("ubuntu-server/daily-preinstalled"))
1800
1910
        self.assertEqual("/ports", self.tree.tree_suffix("ports/daily"))
1801
1911
        self.assertEqual("", self.tree.tree_suffix("daily"))
1802
1912
 
1900
2010
                "20130327"),
1901
2011
            self.get_publisher().daily_dir(
1902
2012
                "daily", "ubuntu-server/daily/20130327", "server"))
 
2013
        self.assertEqual(
 
2014
            os.path.join(
 
2015
                self.temp_dir, "www", "full", "ubuntu-server",
 
2016
                "daily-preinstalled", "20130327"),
 
2017
            self.get_publisher().daily_dir(
 
2018
                "daily-preinstalled",
 
2019
                "ubuntu-server/daily-preinstalled/20130327", "server"))
1903
2020
 
1904
2021
    def test_daily_dir_source(self):
1905
2022
        self.config["PROJECT"] = "ubuntu"