Add new class Service inheritance and test A fo check service ok status
This commit is contained in:
parent
e02e3dc01c
commit
9aedc8c58e
|
@ -273,6 +273,72 @@ class ManualService(PandoraWebDriverTestCase):
|
|||
element = driver.find_element_by_xpath('//td/img[@data-title="Warning"]')
|
||||
self.assertIsInstance(element,WebElement)
|
||||
|
||||
class serviceInsideService(PandoraWebDriverTestCase):
|
||||
|
||||
test_name = u'Auto service tests'
|
||||
test_description = u'Test for check that states are inherited'
|
||||
tickets_associated = []
|
||||
|
||||
agent_name = gen_random_string(6)
|
||||
|
||||
module_ok_1_name = gen_random_string(6)
|
||||
module_warning_1_name = gen_random_string(6)
|
||||
module_critical_1_name = gen_random_string(6)
|
||||
|
||||
@is_enterprise
|
||||
def test_A_service_ok(self):
|
||||
|
||||
u"""
|
||||
Comprobar que un servicio padre hereda el estado del hijo, en este caso "ok"
|
||||
"""
|
||||
|
||||
father_service_name = gen_random_string(6)
|
||||
|
||||
service_name = gen_random_string(6)
|
||||
|
||||
driver = self.driver
|
||||
self.login()
|
||||
detect_and_pass_all_wizards(driver)
|
||||
|
||||
activate_api(driver,"1234")
|
||||
|
||||
#Creamos agentes y modulos warning, critical y ok que usaremos en los 3 test de servicios tipo manual
|
||||
params = [self.agent_name,"127.0.0.1","0","4","0","300","2","pandorafms","2","0","0","pruebas"]
|
||||
create_agent_api(driver,params,user="admin",pwd="pandora")
|
||||
|
||||
params = [self.agent_name,self.module_critical_1_name,"0","6","1","0","0","0","0","0","0","0","0","129.99.40.1","0","0","180","0","0","0","0","Host_Alive"]
|
||||
add_network_module_to_agent_api(driver,params,user="admin",pwd="pandora",apipwd="1234")
|
||||
|
||||
params = [self.agent_name,self.module_warning_1_name,"0","7","1","-10","9999","0","0","0","0","0","0","127.0.0.1","0","0","180","0","0","0","0","Host_Latency"]
|
||||
add_network_module_to_agent_api(driver,params,user="admin",pwd="pandora",apipwd="1234")
|
||||
|
||||
params = [self.agent_name,self.module_ok_1_name,"0","6","1","0","0","0","0","0","0","0","0","127.0.0.1","0","0","180","0","0","0","0","Host_Alive"]
|
||||
add_network_module_to_agent_api(driver,params,user="admin",pwd="pandora",apipwd="1234")
|
||||
|
||||
lista = driver.current_url.split('/')
|
||||
|
||||
url = lista[0]+'//'+lista[2]+'/pandora_console'
|
||||
|
||||
driver.get(url)
|
||||
|
||||
#Creamos el servicio añadiendo modulo en warnining y el servicio será OK
|
||||
create_service(driver,service_name,"Applications",self.agent_name,description=service_name,mode="manual",critical="1",warning="0.5")
|
||||
|
||||
add_elements_to_service(driver,service_name,"Module",agent_name=self.agent_name,module=self.module_ok_1_name,description=self.module_ok_1_name,ok_weight="0.2")
|
||||
add_elements_to_service(driver,service_name,"Module",agent_name=self.agent_name,module=self.module_warning_1_name,description=self.module_warning_1_name,warning_weight="0.2")
|
||||
|
||||
#Creamos el servicio padre
|
||||
create_service(driver,father_service_name,"Applications",self.agent_name,description="this is the father service",mode="manual")
|
||||
|
||||
add_elements_to_service(driver,father_service_name,"Service",service_to_add=father_service_name,description=service_name,ok_weight="0.2")
|
||||
|
||||
force_service(driver,father_service_name)
|
||||
|
||||
search_service(driver,father_service_name,go_to_service=False)
|
||||
|
||||
element = driver.find_element_by_xpath('//td/img[@data-title="Ok"]')
|
||||
self.assertIsInstance(element,WebElement)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest2.main()
|
||||
|
|
Loading…
Reference in New Issue