Пример #1
0
    def test08_uninstall_rpm_on_segments_and_install(self):
        """
        Try to install a gppkg again, when rpm has not been 
        installed on one of the segments.
        """
        #Use gppkg from previous test
        gppkg_file = self.alpha_spec.get_filename()
        self.install(gppkg_file)
   
        segment_host_list = get_host_list()[1]
        self.assertTrue(len(segment_host_list) > 0)
        host = segment_host_list[0]
 
        self.uninstall_rpm_remotely(self.A_spec.get_filename(), host)

        try:
            self.install(gppkg_file) 
        except ExecutionError, e:
            #Install the rpm 
            with closing(tarfile.open(self.alpha_spec.get_filename())) as tf:
                tf.extract(self.A_spec.get_filename())
            Scp(name = "copy rpm to segment", 
                srcFile = self.A_spec.get_filename(), 
                dstFile = self.A_spec.get_filename(), 
                srcHost = None,
                dstHost = host).run(validateAfter = True)
            self.install_rpm_remotely(self.A_spec.get_filename(), host)
            os.remove(self.A_spec.get_filename())
            RemoveRemoteFile(self.A_spec.get_filename(), host).run()
            self.fail("ExecutionError %s" % e)
Пример #2
0
    def test11_install_rpm_on_segments_and_uninstall(self):
        """
        Try to uninstall a gppkg, when the gppkg has not been installed,
        but the main comprising rpm has been installed on one of the segments.
        The desired result is that the rpm should be uninstalled.
        """
        gppkg_file = self.alpha_spec.get_filename()
        
        segment_host_list = get_host_list()[1]
        self.assertTrue(len(segment_host_list) > 0)
        host = segment_host_list[0]

        #Install the rpm
        with closing(tarfile.open(self.alpha_spec.get_filename())) as tf:
            tf.extract(self.A_spec.get_filename())
        Scp(name = "copy rpm to segment",
              srcFile = self.A_spec.get_filename(),
              dstFile = self.A_spec.get_filename(), 
              srcHost = None,
              dstHost = host).run(validateAfter = True)

        self.install_rpm_remotely(self.A_spec.get_filename(), host)

        try:
            self.remove(gppkg_file)
        except ExecutionError, e:
            self.uninstall_rpm_remotely(self.A_spec.get_filename(), host)
            os.remove(self.A_spec.get_filename())
            RemoveRemoteFile(self.A_spec.get_filename(), host).run()
            self.fail("ExecutionError %s" % e)
    def test03_uninstall_rpm_on_standby_and_uninstall(self):
        #Use gppkg from previous test
        gppkg_file = self.alpha_spec.get_filename()
        self.install(gppkg_file)
   
        standby = get_host_list()[0]
 
        self.uninstall_rpm_remotely(self.A_spec.get_filename(), standby)
        self.remove(gppkg_file) 
Пример #4
0
    def test02_no_packages_on_cluster(self):
        """
        This test covers the case when we run clean 
        with no packages installed on the cluster
        """
        run_command(self.clean_command) 
        standby, segment_host_list = get_host_list()
        cluster_host_list = [standby] + [host for host in segment_host_list]        

        for host in cluster_host_list:
            if host is not None:
                self.check_remote_rpm_uninstall(self.A_spec.get_package_name(), host)
                self.assertFalse(CheckRemoteFile(os.path.join(ARCHIVE_PATH, self.alpha_spec.get_filename()), host).run())
    def test01_delete_package_from_archive_on_standby_and_uninstall(self):
        """
            Known issue: MPP-15737
        """
        gppkg_file = self.alpha_spec.get_filename()
        archive_file = os.path.join(ARCHIVE_PATH, gppkg_file)
        self.install(gppkg_file)

        #Remove package from standby
        standby = get_host_list()[0] 
        RemoveRemoteFile(os.path.join(ARCHIVE_PATH, gppkg_file), standby).run()

        try:
            self.remove(gppkg_file)
        except ExecutionError, e:
            GpScp(source_path = gppkg_file,
                  target_path = archive_file,
                  host_list = get_host_list()[1]).run()
            Scp(name = "copy gppkg to standby",
                srcFile = gppkg_file,
                dstFile = archive_file, 
                srcHost = None, 
                dstHost = standby).run(validateAfter = True)
            self.fail("ExecutionError %s" % e)
Пример #6
0
    def test09_uninstall_rpm_on_segments_and_uninstall(self):
        """
        Try to uninstall a gppkg when the rpm has already been 
        uninstalled on one of the segments.
        """
        #Use gppkg from previous test
        gppkg_file = self.alpha_spec.get_filename()
        self.install(gppkg_file)
   
        segment_host_list = get_host_list()[1]
        self.assertTrue(len(segment_host_list) > 0) 
        host = segment_host_list[0]
 
        self.uninstall_rpm_remotely(self.A_spec.get_filename(), host)
        self.remove(gppkg_file) 
Пример #7
0
    def test08_no_rpm_on_standby(self):
        """
        Covers the case when there is no rpm installed on the standby
        but the gppkg is present in the archive and the package has 
        been installed across other hosts in the cluster.
        JIRA - MPP-15968, MPP-15969
        """ 
        self.install(self.alpha_spec.get_filename())
        
        standby = get_host_list()[0]
    
        self.uninstall_rpm_remotely(self.A_spec.get_filename(), standby)
        run_command(self.clean_command)

        self.check_remote_rpm_install(self.A_spec.get_package_name(), standby)
        self.assertTrue(CheckRemoteFile(os.path.join(ARCHIVE_PATH, self.alpha_spec.get_filename()), standby).run())
    def test04_install_rpm_on_standby_and_install(self):
        gppkg_file = self.alpha_spec.get_filename()
 
        standby = get_host_list()[0]
 
        #Install the rpm 
        with closing(tarfile.open(self.alpha_spec.get_filename())) as tf:
            tf.extract(self.A_spec.get_filename())
        Scp(name = "copy the rpm to standby",
            srcFile = self.A_spec.get_filename(),
            dstFile = self.A_spec.get_filename(), 
            srcHost = None, 
            dstHost = standby).run(validateAfter = True)

        self.install_rpm_remotely(self.A_spec.get_filename(), standby)
        self.install(gppkg_file) 
Пример #9
0
    def test07_no_package_on_standby(self):
        """
        This test covers the case when there is no package
        installed on the standby, but the package is installed
        across the other hosts in the cluster.
        JIRA - MPP-15969
        """ 
        self.install(self.alpha_spec.get_filename())

        standby = get_host_list()[0]
        
        RemoveRemoteFile(os.path.join(ARCHIVE_PATH, self.alpha_spec.get_filename()), standby).run()
        self.uninstall_rpm_remotely(self.A_spec.get_filename(), standby)
        run_command(self.clean_command)
    
        self.check_remote_rpm_install(self.A_spec.get_package_name(), standby)
        self.assertTrue(CheckRemoteFile(os.path.join(ARCHIVE_PATH, self.alpha_spec.get_filename()), standby).run())
Пример #10
0
    def test06_no_rpm_on_segment(self):
        """
        This test covers the case when the gppkg has been installed
        on the cluster and the rpm has not been installed properly on
        one of the segments. The gppkg however exists in the archive on
        the segment. 
        """
        self.install(self.alpha_spec.get_filename())
        
        segment_host_list = get_host_list()[1]
        self.assertTrue(len(segment_host_list) > 0)
        host = segment_host_list[0]

        self.uninstall_rpm_remotely(self.A_spec.get_filename(), host)
        run_command(self.clean_command)

        self.check_remote_rpm_install(self.A_spec.get_package_name(), host)
        self.assertTrue(CheckRemoteFile(os.path.join(ARCHIVE_PATH, self.alpha_spec.get_filename()), host).run())
    def test00_delete_package_from_archive_on_standby_and_install(self):
        gppkg_file = self.build(self.alpha_spec, self.A_spec)
        archive_file = os.path.join(ARCHIVE_PATH, gppkg_file)
        self.install(gppkg_file)

        #Remove package from standby
        standby = get_host_list()[0] 
        RemoveRemoteFile(os.path.join(ARCHIVE_PATH, gppkg_file), standby).run()

        try:
            self.install(gppkg_file)
        except ExecutionError, e:
            Scp(name = "copy gppkg to standby",
                srcFile = gppkg_file,
                dstFile = archive_file,
                srcHost = None,
                dstHost = standby).run(validateAfter = True)
            self.fail("ExecutionError %s" % e)
Пример #12
0
    def test04_no_package_on_segment(self):
        """
        This test covers the case when there is no
        package installed on one of the segment, but
        it is installed on the master and everywhere else 
        """
        self.install(self.alpha_spec.get_filename())
       
        segment_host_list = get_host_list()[1]
        self.assertTrue(len(segment_host_list) > 0)
        host = segment_host_list[0]       
 
        RemoveRemoteFile(os.path.join(ARCHIVE_PATH, self.alpha_spec.get_filename()), host).run()

        self.uninstall_rpm_remotely(self.A_spec.get_filename(), host)

        run_command(self.clean_command)

        self.check_remote_rpm_install(self.A_spec.get_package_name(), host)
        self.assertTrue(CheckRemoteFile(os.path.join(ARCHIVE_PATH, self.alpha_spec.get_filename()), host).run())
Пример #13
0
    def test03_no_package_on_master(self):
        """
        This test covers the case when there is no
        package installed on the master, but some
        package is installed on the rest of the cluster
        """
        self.install(self.alpha_spec.get_filename())
        
        os.remove(os.path.join(ARCHIVE_PATH, self.alpha_spec.get_filename()))
     
        self.uninstall_rpm(self.A_spec.get_filename())

        run_command(self.clean_command) 
        standby, segment_host_list = get_host_list()
        cluster_host_list = [standby] + [host for host in segment_host_list]
       
        for host in cluster_host_list:
            if host is not None:
                self.check_remote_rpm_uninstall(self.A_spec.get_package_name(), host)
                self.assertFalse(CheckRemoteFile(os.path.join(ARCHIVE_PATH, self.alpha_spec.get_filename()), host).run())
    def test10_install_rpm_on_segments_and_install(self):
        """
        Try to install a gppkg when an rpm has already been 
        installed on one of the segments.
        """
        gppkg_file = self.alpha_spec.get_filename()

        segment_host_list = get_host_list()[1]
        self.assertTrue(len(segment_host_list) > 0)
        host = segment_host_list[0]

        #Install the rpm
        with closing(tarfile.open(self.alpha_spec.get_filename())) as tf:
            tf.extract(self.A_spec.get_filename())
        Scp(name="copy rpm to segment",
            srcFile=self.A_spec.get_filename(),
            dstFile=self.A_spec.get_filename(),
            srcHost=None,
            dstHost=host).run(validateAfter=True)

        self.install_rpm_remotely(self.A_spec.get_filename(), host)
        self.install(gppkg_file)
Пример #15
0
    def test07_delete_package_from_archive_on_segment_and_uninstall(self):
        """
        Delete a package from the archive on the segment
        and try to uninstall the gppkg.
        """
        gppkg_file = self.alpha_spec.get_filename()
        archive_file = os.path.join(ARCHIVE_PATH, gppkg_file)
        self.install(gppkg_file)

        #Remove package from archive
        segment_host_list = get_host_list()[1]
        self.assertTrue(len(segment_host_list) > 0)
        host = segment_host_list[0]
        RemoveRemoteFile(archive_file ,host).run()

        try:
            self.remove(gppkg_file)
        except ExecutionError, e:
            GpScp(source_path = gppkg_file,
                  target_path = archive_file,
                  host_list = segment_host_list).run()
            self.fail("ExecutionError %s" % str(e))
Пример #16
0
    def test10_install_rpm_on_segments_and_install(self):
        """
        Try to install a gppkg when an rpm has already been 
        installed on one of the segments.
        """
        gppkg_file = self.alpha_spec.get_filename()
 
        segment_host_list = get_host_list()[1]
        self.assertTrue(len(segment_host_list) > 0)
        host = segment_host_list[0]
 
        #Install the rpm 
        with closing(tarfile.open(self.alpha_spec.get_filename())) as tf:
            tf.extract(self.A_spec.get_filename())
        Scp(name = "copy rpm to segment", 
            srcFile = self.A_spec.get_filename(), 
            dstFile = self.A_spec.get_filename(), 
            srcHost = None, 
            dstHost = host).run(validateAfter = True)

        self.install_rpm_remotely(self.A_spec.get_filename(), host)
        self.install(gppkg_file) 
Пример #17
0
    def test07_delete_package_from_archive_on_segment_and_uninstall(self):
        """
        Delete a package from the archive on the segment
        and try to uninstall the gppkg.
        """
        gppkg_file = self.alpha_spec.get_filename()
        archive_file = os.path.join(ARCHIVE_PATH, gppkg_file)
        self.install(gppkg_file)

        #Remove package from archive
        segment_host_list = get_host_list()[1]
        self.assertTrue(len(segment_host_list) > 0)
        host = segment_host_list[0]
        RemoveRemoteFile(archive_file, host).run()

        try:
            self.remove(gppkg_file)
        except ExecutionError as e:
            GpScp(source_path=gppkg_file,
                  target_path=archive_file,
                  host_list=segment_host_list).run()
            self.fail("ExecutionError %s" % str(e))
    def test02_uninstall_rpm_on_standby_and_install(self):
        #Use gppkg from previous test
        gppkg_file = self.alpha_spec.get_filename()
        self.install(gppkg_file)
   
        standby = get_host_list()[0]
 
        self.uninstall_rpm_remotely(self.A_spec.get_filename(), standby)
        try:
            self.install(gppkg_file) 
        except ExecutionError, e:
            #Install the rpm 
            with closing(tarfile.open(self.alpha_spec.get_filename())) as tf:
                tf.extract(self.A_spec.get_filename())
            Scp(name = "copy rpm to standby", 
                srcFile = self.A_spec.get_filename(), 
                dstFile = self.A_spec.get_filename(), 
                srcHost = None,
                dstHost = standby).run(validateAfter = True)
            self.install_rpm_remotely(self.A_spec.get_filename(), standby)
            os.remove(self.A_spec.get_filename())
            RemoveRemoteFile(self.A_spec.get_filename(), standby).run()
            self.fail("ExecutionError %s" % e)
    def test02_uninstall_rpm_on_standby_and_install(self):
        #Use gppkg from previous test
        gppkg_file = self.alpha_spec.get_filename()
        self.install(gppkg_file)

        standby = get_host_list()[0]

        self.uninstall_rpm_remotely(self.A_spec.get_filename(), standby)
        try:
            self.install(gppkg_file)
        except ExecutionError as e:
            #Install the rpm
            with closing(tarfile.open(self.alpha_spec.get_filename())) as tf:
                tf.extract(self.A_spec.get_filename())
            Scp(name="copy rpm to standby",
                srcFile=self.A_spec.get_filename(),
                dstFile=self.A_spec.get_filename(),
                srcHost=None,
                dstHost=standby).run(validateAfter=True)
            self.install_rpm_remotely(self.A_spec.get_filename(), standby)
            os.remove(self.A_spec.get_filename())
            RemoveRemoteFile(self.A_spec.get_filename(), standby).run()
            self.fail("ExecutionError %s" % e)
    def test06_delete_package_from_archive_on_segment_and_install(self):
        """
        Delete a package from the archive on the segment 
        and try to install the gppkg again.
        """
        gppkg_file = self.alpha_spec.get_filename()
        archive_file = os.path.join(ARCHIVE_PATH, gppkg_file)
        self.install(gppkg_file)

        #Remove package from archive
        segment_host_list = get_host_list()[1]
        self.assertTrue(len(segment_host_list) > 0)
        host = segment_host_list[0]
        RemoveRemoteFile(archive_file, host).run()

        try:
            self.install(gppkg_file)
        except ExecutionError as e:
            Scp(name="copy gppkg to segment",
                srcFile=gppkg_file,
                dstFile=archive_file,
                srcHost=None,
                dstHost=host).run(validateAfter=True)
            self.fail("ExecutionError %s" % e)
Пример #21
0
    def test06_delete_package_from_archive_on_segment_and_install(self):
        """
        Delete a package from the archive on the segment 
        and try to install the gppkg again.
        """
        gppkg_file = self.alpha_spec.get_filename()
        archive_file = os.path.join(ARCHIVE_PATH, gppkg_file)
        self.install(gppkg_file)

        #Remove package from archive
        segment_host_list = get_host_list()[1]
        self.assertTrue(len(segment_host_list) > 0)
        host = segment_host_list[0]
        RemoveRemoteFile(archive_file ,host).run()

        try:
            self.install(gppkg_file)
        except ExecutionError, e:
            Scp(name = "copy gppkg to segment",
                srcFile = gppkg_file, 
                dstFile = archive_file, 
                srcHost = None,
                dstHost = host).run(validateAfter = True)
            self.fail("ExecutionError %s" % e)
Пример #22
0
    def setUp(self):
        super(CleanGppkgTestCase, self).setUp()
        self.clean_command = "gppkg --clean"

        standby, segment_host_list = get_host_list()
        cluster_host_list = [standby] + [host for host in segment_host_list]        
Пример #23
0
    def setUp(self):
        super(CleanGppkgTestCase, self).setUp()
        self.clean_command = "gppkg --clean"

        standby, segment_host_list = get_host_list()
        cluster_host_list = [standby] + [host for host in segment_host_list]