def initialSetUp(self): global app, md5StdNum, appSSL, appSSLData, canRelay # download eicar and trojan files before installing virus blocker self.ftp_user_name, self.ftp_password = global_functions.get_live_account_info( "ftp") remote_control.run_command( "rm -f /tmp/eicar /tmp/std_022_ftpVirusBlocked_file /tmp/temp_022_ftpVirusPassSite_file" ) result = remote_control.run_command( "wget --user="******" --password='******' -q -O /tmp/eicar http://test.untangle.com/virus/eicar.com") assert (result == 0) result = remote_control.run_command( "wget --user="******" --password='******' -q -O /tmp/std_022_ftpVirusBlocked_file ftp://" + global_functions.ftp_server + "/virus/fedexvirus.zip") assert (result == 0) md5StdNum = remote_control.run_command( "\"md5sum /tmp/std_022_ftpVirusBlocked_file | awk '{print $1}'\"", stdout=True) self.md5StdNum = md5StdNum # print("md5StdNum <%s>" % md5StdNum) assert (result == 0) try: canRelay = global_functions.send_test_email(mailhost=testsiteIP) except Exception, e: canRelay = False
def initialSetUp(self): global app, appData, appSP, appDataSP, appSSL, appSSLData, canRelay if (uvmContext.appManager().isInstantiated(self.appName())): raise unittest2.SkipTest('app %s already instantiated' % self.appName()) app = uvmContext.appManager().instantiate(self.appName(), default_policy_id) appData = app.getSettings() appSP = uvmContext.appManager().app(self.appNameSpamCase()) appDataSP = appSP.getSmtpSettings() if uvmContext.appManager().isInstantiated(self.appNameSSLInspector()): raise Exception('app %s already instantiated' % self.appNameSSLInspector()) appSSL = uvmContext.appManager().instantiate(self.appNameSSLInspector(), default_policy_id) # appSSL.start() # leave app off. app doesn't auto-start appSSLData = appSSL.getSettings() try: canRelay = global_functions.send_test_email(mailhost=smtpServerHost) except Exception,e: canRelay = False
def initialSetUp(self): global app, orig_settings, test_email_address, can_relay, can_syslog, syslog_server_host, web_app if (uvmContext.appManager().isInstantiated(self.appName())): # report app is normally installed. # print("App %s already installed" % self.appName()) # raise Exception('app %s already instantiated' % self.appName()) app = uvmContext.appManager().app(self.appName()) else: app = uvmContext.appManager().instantiate(self.appName(), default_policy_id) reportSettings = app.getSettings() orig_settings = copy.deepcopy(reportSettings) if (uvmContext.appManager().isInstantiated(self.webAppName())): raise Exception('app %s already instantiated' % self.webAppName()) web_app = uvmContext.appManager().instantiate(self.webAppName(), default_policy_id) # Skip checking relaying is possible if we have determined it as true on previous test. try: can_relay = global_functions.send_test_email() except Exception,e: can_relay = False