Пример #1
0
    def test02_simple_update(self):
        gppkg_file = self.alpha_spec.get_filename()
        self.install(gppkg_file)

        update_rpm_spec = RPMSpec("A", "1", "2")
        update_gppkg_spec = GppkgSpec("alpha", "1.1")
        update_gppkg_file = self.build(update_gppkg_spec, update_rpm_spec)

        self.update(update_gppkg_file)

        #Check for the packages
        self.check_rpm_install(update_rpm_spec.get_package_name())
Пример #2
0
 def test03_update_gppkg_lower(self):
     """
     This test tries to update a gppkg with a lower version 
     and the main and dependent rpms with a lower version.
     """
     #Use the gppkg from previous test
     update_main_rpm_spec = RPMSpec("A", "1", "2", ["B = 1-2"])
     update_dep_rpm_spec = RPMSpec("B", "1", "2")
     update_gppkg_spec = GppkgSpec("alpha", "1.1")
     self.install(update_gppkg_spec.get_filename())
 
     #Original gppkg with a lower gppkg, main and deps version
     with self.assertRaisesRegexp(ExecutionError, "A newer version of %s is already installed" % self.alpha_spec.get_filename()):
         self.update(self.alpha_spec.get_filename())
Пример #3
0
 def test02_update_gppkg_higher(self):
     """
     This test tries to update a gppkg with a higher version 
     and the main and dependent rpms with a higher version.
     """
     #Use gppkg from previous test
     self.install(self.alpha_spec.get_filename())
     
     #New gppkg with higher gppkg, main and deps version
     update_main_rpm_spec = RPMSpec("A", "1", "2", ["B = 1-2"])
     update_dep_rpm_spec = RPMSpec("B", "1", "2")
     update_gppkg_spec = GppkgSpec("alpha", "1.1")
     update_gppkg_file = self.build(update_gppkg_spec, update_main_rpm_spec, [update_dep_rpm_spec]) 
     
     self.update(update_gppkg_file) 
Пример #4
0
    def test05_update_dependencies_incompatible(self):
        """
        Installs gppkg alpha with dependencies B, shared
        Update gppkg alpha' with dependencies B, shared
        where version(alpha'.shared) < version(alpha.shared) and version(alpha') > version(alpha)
        """
        update_gppkg_spec = GppkgSpec("alpha", "2.0")
        B_spec = self.B_spec
        A_spec = RPMSpec("A", "1", "1", ["B = 1-1", "shared = 0-1"])
        shared_dep_spec = RPMSpec("shared", "0", "1")
        self.build(update_gppkg_spec, A_spec, [B_spec, shared_dep_spec])

        self.install(self.alpha_spec.get_filename())

        with self.assertRaises(ExecutionError):
            self.update(update_gppkg_spec.get_filename())
Пример #5
0
    def test03_update(self):
        """
        Covers the case of update of gppkg with a shared dependency
        """
        self.install(self.alpha_spec.get_filename())
        self.install(self.beta_spec.get_filename())

        #package to be updated
        update_spec = GppkgSpec("alpha", "1.1")
        rpm_spec = RPMSpec("A", "1", "2", ["B = 1-1", "shared >= 2-1"])
        dep_spec = self.B_spec
        shared_dep_spec = RPMSpec("shared", "2", "1")
        self.build(update_spec, rpm_spec, [dep_spec, shared_dep_spec])

        self.update(update_spec.get_filename())

        self.check_rpm_uninstall(self.shared_dep_spec.get_package_name())
        self.check_rpm_install(shared_dep_spec.get_package_name())
Пример #6
0
    def test05_update_rpm_lower(self):
        """
        This test tries to install a gppkg which has a higher version,
        but the main comprising rpm is of lower version than the one
        already installed on the system.
        """
        #Use gppkg from previous test
        self.install(self.alpha_spec.get_filename())

        #Use gppkg with a lower RPM version but gppkg version is > the one installed
        update_rpm_spec = RPMSpec("A", "1", "0")
        update_gppkg_spec = GppkgSpec("alpha", "1.1")
        update_gppkg_file = self.build(update_gppkg_spec, update_rpm_spec)

        with self.assertRaisesRegex(ExecutionError,
                                    self.A_spec.get_filename()):
            self.update(update_gppkg_file)
        #Check that the original package is still installed and not updated
        assert self.check_install(self.alpha_spec.get_filename())
Пример #7
0
 def setUp(self):
     super(SingleDependenciesTestCase, self).cleanup()
     self.A_spec = RPMSpec("A", "1", "1", ["B = 1-1"])
     self.B_spec = RPMSpec("B", "1", "1")
     self.alpha_spec = GppkgSpec("alpha", "1.0")