예제 #1
0
    def test_repo_to_kickstart(self):
        repo_str_1 = 'repo --name=fedora --baseurl=http://fedoraproject.org/ --install'
        repo_str_2 = 'repo --name=fedora2 --mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch'
        # TODO: Metalink cannot be specified in string mode

        repo_str_3 = 'repo --name=fedora3 --cost=1337 --excludepkgs=1'
        repo_str_4 = 'repo --name=fedora3 --excludepkgs=python,perl --proxy=http://fakeproxy:1337'

        repo_str_5 = 'repo --name=fedora3 --includepkgs=python --ignoregroups=true'
        repo_str_6 = 'repo --name=fedora3 --includepkgs=python,ruby --noverifyssl'

        repo1 = Repository(repo_str_1)
        repo2 = Repository(repo_str_2)
        repo3 = Repository(repo_str_3)
        repo4 = Repository(repo_str_4)
        repo5 = Repository(repo_str_5)
        repo6 = Repository(repo_str_6)

        ks1 = repo1.to_kickstart()
        ks2 = repo2.to_kickstart()
        ks3 = repo3.to_kickstart()
        ks4 = repo4.to_kickstart()
        ks5 = repo5.to_kickstart()
        ks6 = repo6.to_kickstart()

        # baseurl and install
        self.assertEqual(repo_str_1, ks1)
        # mirrorlist
        self.assertEqual(repo_str_2, ks2)

        # cost and exclude one package
        self.assertEqual(repo_str_3, ks3)
        # proxy and exclude multiple packages
        self.assertEqual(repo_str_4, ks4)

        # ignoregroups and include one package
        self.assertEqual(repo_str_5, ks5)
        # noverifyssl and include multiple packages
        self.assertEqual(repo_str_6, ks6)
예제 #2
0
    def test_repo_to_kickstart(self):
        repo_str_1 = 'repo --name=fedora --baseurl=http://fedoraproject.org/ --install'
        repo_str_2 = 'repo --name=fedora2 --mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch'
        # TODO: Metalink cannot be specified in string mode

        repo_str_3 = 'repo --name=fedora3 --cost=1337 --excludepkgs=1'
        repo_str_4 = 'repo --name=fedora3 --excludepkgs=python,perl --proxy=http://fakeproxy:1337'

        repo_str_5 = 'repo --name=fedora3 --includepkgs=python --ignoregroups=true'
        repo_str_6 = 'repo --name=fedora3 --includepkgs=python,ruby --noverifyssl'

        repo1 = Repository(repo_str_1)
        repo2 = Repository(repo_str_2)
        repo3 = Repository(repo_str_3)
        repo4 = Repository(repo_str_4)
        repo5 = Repository(repo_str_5)
        repo6 = Repository(repo_str_6)

        ks1 = repo1.to_kickstart()
        ks2 = repo2.to_kickstart()
        ks3 = repo3.to_kickstart()
        ks4 = repo4.to_kickstart()
        ks5 = repo5.to_kickstart()
        ks6 = repo6.to_kickstart()

        # baseurl and install
        self.assertEqual(repo_str_1, ks1)
        # mirrorlist
        self.assertEqual(repo_str_2, ks2)

        # cost and exclude one package
        self.assertEqual(repo_str_3, ks3)
        # proxy and exclude multiple packages
        self.assertEqual(repo_str_4, ks4)

        # ignoregroups and include one package
        self.assertEqual(repo_str_5, ks5)
        # noverifyssl and include multiple packages
        self.assertEqual(repo_str_6, ks6)