Example #1
0
    def test_sanity_check(self):
        t = MasherThread(u'F17', u'testing', [u'bodhi-2.0-1.fc17'], log,
                         self.db_factory, self.tempdir)
        t.id = 'f17-updates-testing'
        t.init_path()

        # test without any arches
        try:
            t.sanity_check_repo()
            assert False, "Sanity check didn't fail with empty dir"
        except:
            pass

        # test with valid repodata
        for arch in ('i386', 'x86_64', 'armhfp'):
            repo = os.path.join(t.path, t.id, arch)
            os.makedirs(repo)
            mkmetadatadir(repo)

        t.sanity_check_repo()

        # test with truncated/busted repodata
        xml = os.path.join(t.path, t.id, 'i386', 'repodata', 'repomd.xml')
        repomd = open(xml).read()
        with open(xml, 'w') as f:
            f.write(repomd[:-10])

        from bodhi.exceptions import RepodataException
        try:
            t.sanity_check_repo()
            assert False, 'Busted metadata passed'
        except RepodataException:
            pass
Example #2
0
    def test_sanity_check(self):
        t = MasherThread(u"F17", u"testing", [u"bodhi-2.0-1.fc17"], log, self.db_factory, self.tempdir)
        t.id = "f17-updates-testing"
        t.init_path()

        # test without any arches
        try:
            t.sanity_check_repo()
            assert False, "Sanity check didn't fail with empty dir"
        except:
            pass

        # test with valid repodata
        for arch in ("i386", "x86_64", "armhfp"):
            repo = os.path.join(t.path, t.id, arch)
            os.makedirs(repo)
            mkmetadatadir(repo)

        t.sanity_check_repo()

        # test with truncated/busted repodata
        xml = os.path.join(t.path, t.id, "i386", "repodata", "repomd.xml")
        repomd = open(xml).read()
        with open(xml, "w") as f:
            f.write(repomd[:-10])

        from bodhi.exceptions import RepodataException

        try:
            t.sanity_check_repo()
            assert False, "Busted metadata passed"
        except RepodataException:
            pass
Example #3
0
    def test_sanity_check(self):
        t = MasherThread(u'F17', u'testing', [u'bodhi-2.0-1.fc17'],
                         log, self.db_factory, self.tempdir)
        t.id = 'f17-updates-testing'
        t.init_path()

        # test without any arches
        try:
            t.sanity_check_repo()
            assert False, "Sanity check didn't fail with empty dir"
        except:
            pass

        # test with valid repodata
        for arch in ('i386', 'x86_64', 'armhfp'):
            repo = os.path.join(t.path, t.id, arch)
            os.makedirs(repo)
            mkmetadatadir(repo)

        t.sanity_check_repo()

        # test with truncated/busted repodata
        xml = os.path.join(t.path, t.id, 'i386', 'repodata', 'repomd.xml')
        repomd = open(xml).read()
        with open(xml, 'w') as f:
            f.write(repomd[:-10])

        from bodhi.exceptions import RepodataException
        try:
            t.sanity_check_repo()
            assert False, 'Busted metadata passed'
        except RepodataException:
            pass
Example #4
0
 def test_stage(self):
     t = MasherThread(u"F17", u"testing", [u"bodhi-2.0-1.fc17"], log, self.db_factory, self.tempdir)
     t.id = "f17-updates-testing"
     t.init_path()
     t.stage_repo()
     stage_dir = config.get("mash_stage_dir")
     link = os.path.join(stage_dir, t.id)
     self.assertTrue(os.path.islink(link))
Example #5
0
 def test_stage(self):
     t = MasherThread(u'F17', u'testing', [u'bodhi-2.0-1.fc17'], log,
                      self.db_factory, self.tempdir)
     t.id = 'f17-updates-testing'
     t.init_path()
     t.stage_repo()
     stage_dir = config.get('mash_stage_dir')
     link = os.path.join(stage_dir, t.id)
     self.assertTrue(os.path.islink(link))
Example #6
0
 def test_stage(self):
     t = MasherThread(u'F17', u'testing', [u'bodhi-2.0-1.fc17'],
                      log, self.db_factory, self.tempdir)
     t.id = 'f17-updates-testing'
     t.init_path()
     t.stage_repo()
     stage_dir = config.get('mash_stage_dir')
     link = os.path.join(stage_dir, t.id)
     self.assertTrue(os.path.islink(link))