def run(self):
		results = {}
		my_path = "nsClientAuto.tests.ClientUninstallTest"
		test_unique_id = "ClientUninstallTest"
		begin = int(time.time())
		try:
			from nsClientAuto.lib.client.NSClient import NSClient		
			client = NSClient(self.config)
			# Place your installation instructions and checks here
			client.uninstallApp()
			end = int(time.time())
			results[test_unique_id]	= {
										 "RESULT" : "PASS",
										 "CLASS_NAME" : my_path,
										 "TIME" : end - begin,
										 "MESSAGE" : None,
										 "TRACE" : None
									}									
		except AssertionError, e:
			import traceback
			end = int(time.time())
			results[test_unique_id]	= {
										 "RESULT" : "FAIL",
										 "CLASS_NAME" : my_path,
										 "TIME" : end - begin,
										 "MESSAGE" : str(e),
										 "TRACE" : traceback.format_exc()
									}
Exemple #2
0
	def prepare(self):
		os.chdir(fwork.NSUI_PATH)
		report_dir = os.path.join(fwork.REPORT_DIR, self.config.options.run_id)
		nsui_log_dir = os.path.join(report_dir, "log")		
		self.config.report_dir = report_dir
		self.config.nsui_log_dir = nsui_log_dir		
		if not os.path.isdir(report_dir):	
			os.makedirs(report_dir)
		if not os.path.isdir(nsui_log_dir):	
			os.makedirs(nsui_log_dir)
		self.config.build_dir = self.config.options.build_dir
		builds = self.config.options.build_num
		if not self.config.options.no_install:
			if builds == "NOT_SET":
				raise Exception("No Build number provided")
			else:
				builds =  [s.strip() for s in builds.split(":")]
				self.config.base_build = builds[0]
				if len(builds) > 1:
					self.config.target_build = builds[1]
		else:
			import platform
			if platform.system() == "Windows":
				NSObj = NSClient()
				NSObj.enableNSClientFromSysTray()
			else:
				pass
		self.build_dir = self.config.options.build_dir			
		self.reporter = TabDelimitedReporter(self.config)
Exemple #3
0
    def run(self):
        results = {}
        my_path = "nsClientAuto.tests.ClientInstallTest"
        test_unique_id = "ClientInstallTest"
        begin = int(time.time())
        try:
            from nsClientAuto.lib.client.NSClient import NSClient

            client = NSClient(self.config)
            # Place your installation instructions and checks here
            builds = self.config.options.build_num
            if builds == "NOT_SET":
                raise Exception("No Build number provided")
            else:
                builds = [s.strip() for s in builds.split(":")]
            self.config.base_build = builds[0]
            if len(builds) > 1:
                client.upgradeApp()
            else:
                client.installApp()
            end = int(time.time())
            results[test_unique_id] = {
                "RESULT": "PASS",
                "CLASS_NAME": my_path,
                "TIME": end - begin,
                "MESSAGE": None,
                "TRACE": None,
            }
        except AssertionError, e:
            import traceback

            end = int(time.time())
            results[test_unique_id] = {
                "RESULT": "FAIL",
                "CLASS_NAME": my_path,
                "TIME": end - begin,
                "MESSAGE": str(e),
                "TRACE": traceback.format_exc(),
            }