Exemple #1
0
 def runTest(self):
     url=Baseurl+"add"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :"+url + " For Create Deployment Group Request test"
     payload={"deployment_requests":[{"parent_entity_id":str(VersionsDb.get_last_active_version_by_tool_id(str(ToolDb.get_tool_by_name("jTrace").get("_id")),False).get("_id")),
                                      "requested_by":"SuperAdmin",
                                      "request_type":"deploy",
                                      "deployment_type":"toolgroup",
                                      "callback_url": "http://*****:*****@1.1.1.1")[0].get("_id")),
                                                   "tool_deployment_value":[{"input_name":"debug_host",
                                                                             "input_type":"text",
                                                                             "input_value":"TEST",
                                                                             "order_id":1},
                                                                            {"input_name":"debug_port",
                                                                             "input_type":"text",
                                                                             "input_value":"8899",
                                                                             "order_id":2}],"warning_flag":False,
                                                   "skip_dep_ind":False}],
                                      "scheduled_date":"2018-02-27T08:48:47.222Z",
                                      "build_number":20,
                                      "build_id": str(BuildDb.get_active_build_for_unittest(str(VersionsDb.get_last_active_version_by_tool_id(str(ToolDb.get_tool_by_name("jTrace").get("_id")),False).get("_id"))))}]}
     response = requests.request("POST", url, data=json.dumps(payload), headers=header,verify=False)
     verifyResponse.PositiveTesting(response)
     json_data = json.loads(response.text)
     AddDepGroupReqTest.oid = str(json_data.get("data").get("id"))
     enable_callback = ConfigDb.getConfigByName('DeploymentRequestService').get("enable_callback")
     if enable_callback == "false" or not enable_callback:
         return
     callback_url = DeploymentRequestGroupdb.get_group_deployment_request(AddDepGroupReqTest.oid).get("callback").get("callback_url")
     assert callback_url == payload.get("deployment_requests")[0].get("callback_url"), "FAILURE: Callback URL did not register to database. Response is " + str(response.text)
Exemple #2
0
 def runTest(self):
     url = Baseurl + "update"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Deprecate tool test"
     payload = {
         "_id": {
             "oid": AddToolTest.oid
         },
         "name":
         "UnitTestTool",
         "tag": [],
         "support_details":
         "[email protected]",
         "description":
         "TEST123",
         "version": [{
             "_id": {
                 "oid": AddToolTest.version_id
             },
             "version_date": "2018-02-16 14:44:47.021 ",
             "version_number": "3",
             "gitlab_branch": "",
             "tool_id": AddToolTest.oid,
             "status": "1",
             "branch_tag": "Branch"
         }],
         "status":
         "3"
     }
     response = requests.request("PUT",
                                 url,
                                 data=json.dumps(payload),
                                 headers=header,
                                 verify=False)
     verifyResponse.PositiveTesting(response)
    def runTest(self):
        url = Baseurl + "update"
        print "--------------------------------------------------------------------------------------------------------"
        print "Calling API :" + url + " For Update DuSet test"
        payload = {
            "_id": {
                "oid": AddDuSetTest.DuSetoid
            },
            "du_set": [{
                "du_id": AddDuSetTest.Duoid1,
                "dependent": "false",
                "order": 1
            }, {
                "du_id": AddDuSetTest.Duoid2,
                "dependent": "false",
                "order": 2
            }],
            "name":
            "UnitTestDuSet",
            "tag": [],
            "logo":
            "/static/files/logos/default_u.png",
            "release_notes":
            "Yet to be released",
            "pre_requiests": []
        }

        response = requests.request("PUT",
                                    url,
                                    data=json.dumps(payload),
                                    headers=header,
                                    verify=False)
        verifyResponse.PositiveTesting(response)
 def runTest(self):
     url = Baseurl + "new"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Create Du test"
     payload = {
         "name":
         "TestDU",
         "type":
         "Fast Track",
         "tag": [],
         "release_notes":
         "",
         "branch":
         "",
         "pre_requiests": [],
         "deployment_field": {
             "fields": []
         },
         "approval_status":
         "Created",
         "approval_list": [{
             "approval_status": "Created",
             "approved_by": "Admin",
             "approved_date": "2018-02-20T09:36:19.512Z"
         }]
     }
     response = requests.request("POST",
                                 url,
                                 data=json.dumps(payload),
                                 headers=header,
                                 verify=False)
     verifyResponse.PositiveTesting(response)
     json_data = json.loads(response.text)
     AddDuTest.oid = str(json_data.get("data").get("_id"))
    def runTest(self):
        url = Baseurl + "update"
        print "--------------------------------------------------------------------------------------------------------"
        print "Calling API :" + url + " For Update Du test"
        payload = {
            "_id": {
                "oid": AddDuTest.oid
            },
            "name": "TestDU",
            "type": "Version",
            "tag": [],
            "release_notes": "",
            "branch": "",
            "pre_requiests": [],
            "deployment_field": {
                "fields": []
            }
        }

        response = requests.request("PUT",
                                    url,
                                    data=json.dumps(payload),
                                    headers=header,
                                    verify=False)
        verifyResponse.PositiveTesting(response)
Exemple #6
0
 def runTest(self):
     url = Baseurl + "fav/machine/" + AddMachineTest.oid + "/user/" + str(
         UsersDb.get_user_by_name("SuperAdmin"))
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Get User Fav by Machine Id Machine test"
     response = requests.request("GET", url, headers=header, verify=False)
     verifyResponse.PositiveTesting(response)
Exemple #7
0
 def runTest(self):
     url = Baseurl + "remove/" + AddMachineTest.oid
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Delete Machine test"
     response = requests.request("DELETE",
                                 url,
                                 headers=header,
                                 verify=False)
     verifyResponse.PositiveTesting(response)
 def runTest(self):
     url = Baseurl + "delete/" + AddDuSetTest.DuSetoid
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Deleting DuSet test"
     response = requests.request("DELETE",
                                 url,
                                 headers=header,
                                 verify=False)
     verifyResponse.PositiveTesting(response)
Exemple #9
0
 def runTest(self):
     if SyncViewAllTest.sync_id:
         url = Baseurl + "view/syncid/" + SyncViewAllTest.sync_id
     else:
         url = Baseurl + "view/syncid/dummy"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Get by Sync_id  test"
     response = requests.request("GET", url, headers=header, verify=False)
     verifyResponse.PositiveTesting(response)
Exemple #10
0
 def runTest(self):
     url = Baseurl + "view/all"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Sync view all test"
     response = requests.request("GET", url, headers=header, verify=False)
     verifyResponse.PositiveTesting(response)
     json_data = json.loads(response.text)
     data = json_data.get("data").get("data")
     rec = data[0]
     SyncViewAllTest.sync_id = rec.get("sync_id")
 def runTest(self):
     CreateMachinesForMachineGroup()
     url=Baseurl+"add"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :"+url + " For Create MachineGroup test"
     payload={"group_name":"UnitTestMachineGroup",
              "machine_id_list":[AddMachineGroupTest.MacOid1,
                                 AddMachineGroupTest.MacOid2]}
     response = requests.request("POST", url, data=json.dumps(payload), headers=header,verify=False)
     verifyResponse.PositiveTesting(response)
     json_data = json.loads(response.text)
     AddMachineGroupTest.oid = str(json_data.get("data").get("id"))
 def runTest(self):
     url=Baseurl+"update"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :"+url + " For Update MachineGroup test"
     payload={"_id":{"oid":AddMachineGroupTest.oid},
              "group_name":"UnitTestMachineGroup",
              "description":"Test",
              "machine_id_list":[AddMachineGroupTest.MacOid1,
                                 AddMachineGroupTest.MacOid2]}
     
     response = requests.request("PUT", url, data=json.dumps(payload), headers=header,verify=False)
     verifyResponse.PositiveTesting(response)
Exemple #13
0
 def runTest(self):
     url=Baseurl+"machinegroup/new"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :"+url + " For Create Deployment Group Request test"
     payload={
             "machine_group_id":str(MachineGroupsDb.get_machine_group_by_name("TestMachineGroup1").get("_id")),
             "parent_entity_set_id":str(DeploymentUnitSetDb.GetDeploymentUnitSetByName("Test Du Package", False).get("_id")),                "skip_dep_ind":True,
             "machine_matching_ind":True
             }
     response = requests.request("POST", url, data=json.dumps(payload), headers=header,verify=False)
     verifyResponse.PositiveTesting(response)
     json_data = json.loads(response.text)
     CreateDepGrpReqByGrpIdTest.oid = str(json_data.get("data").get("id"))
Exemple #14
0
 def runTest(self):
     url = Baseurl + "approve"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Create Proposed Tool test"
     payload["_id"] = AddProposedToolTest.oid
     response = requests.request("POST",
                                 url,
                                 data=json.dumps(payload),
                                 headers=header,
                                 verify=False)
     verifyResponse.PositiveTesting(response)
     json_data = json.loads(response.text)
     AddProposedToolTest.oid = str(json_data.get("data").get("_id"))
Exemple #15
0
 def runTest(self):
     url=Baseurl+"saved/add"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :"+url + " For Save Deployment Group Request test"
     payload = {"deployment_type":"toolgroup",
                "data":[{"tool_id":str(ToolDb.get_tool_by_name("jTrace").get("_id")),
                         "tool_name":"jTrace",
                         "version_number":"0.1.0",
                         "tool_deployment_value":[{"default_value":"",
                                                   "is_mandatory":True,
                                                   "order_id":1,
                                                   "input_type":"text",
                                                   "tooltip":"",
                                                   "input_name":"debug_host"},
                                                  {"default_value":"8899",
                                                   "is_mandatory":True,
                                                   "order_id":2,
                                                   "input_type":"text",
                                                   "tooltip":"",
                                                   "input_name":"debug_port"}],
                         "build_number":20,
                         "build_id":str(BuildDb.get_active_build_for_unittest(str(VersionsDb.get_last_active_version_by_tool_id(str(ToolDb.get_tool_by_name("jTrace").get("_id")),False).get("_id")))),
                         "requests":[{"tool_name":"jTrace",
                                      "tool_deployment_value":[{"default_value":"wte",
                                                                "is_mandatory":True,
                                                                "order_id":1,
                                                                "input_type":"text",
                                                                "tooltip":"",
                                                                "input_name":"debug_host"},
                                                               {"default_value":"8899",
                                                                "is_mandatory":True,
                                                                "order_id":2,
                                                                "input_type":"text",
                                                                "tooltip":"",
                                                                "input_name":"debug_port"}],
                                      "machine_id":str(MachineDb.GetMachinebyName("[email protected]")[0].get("_id")),
                                      "machine_name":"[email protected]","skip_deployment":False,
                                      "is_build_already_deployed":False,"isDefault":True,
                                      "isCopiedToAllMachines":False,
                                      "warning_flag":False}],
                         "version_id":str(VersionsDb.get_last_active_version_by_tool_id(str(ToolDb.get_tool_by_name("jTrace").get("_id")),False).get("_id"))}]}
     
     response = requests.request("POST", url, data=json.dumps(payload), headers=header,verify=False)
     verifyResponse.PositiveTesting(response)
     json_data = json.loads(response.text)
     SaveDepGroupReqTest.oid = str(json_data.get("data"))
Exemple #16
0
    def runTest(self):
        url = Baseurl + "new"
        print "--------------------------------------------------------------------------------------------------------"
        print "Calling API :" + url + " For Create Machine test"
        payload = {
            "permitted_users": ["all"],
            "included_in": [],
            "permitted_teams": [],
            "port":
            22,
            "shell_type":
            "",
            "reload_command":
            "",
            "tag": ["test"],
            "fav":
            False,
            "auth_type":
            "password",
            "machine_name":
            "UnitTestMachine",
            "ip":
            "10.19.87.107",
            "host":
            "vptestind01",
            "username":
            "******",
            "password":
            "******",
            "machine_type":
            str(MachineTypeDb.get_machine_type_by_name("ST").get("_id")),
            "account_id":
            str(AccountsDb.get_account_by_name("Test").get("_id")),
            "status":
            "1",
            "steps_to_auth": []
        }

        response = requests.request("POST",
                                    url,
                                    data=json.dumps(payload),
                                    headers=header,
                                    verify=False)
        verifyResponse.PositiveTesting(response)
        json_data = json.loads(response.text)
        AddMachineTest.oid = str(json_data.get("data").get("id"))
Exemple #17
0
 def runTest(self):
     url = Baseurl + "fav/new"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Add Fav Machine test"
     payload = {
         "user_id": str(UsersDb.get_user_by_name("SuperAdmin")),
         "machine_id": AddMachineTest.oid,
         "status": 1
     }
     response = requests.request("POST",
                                 url,
                                 data=json.dumps(payload),
                                 headers=header,
                                 verify=False)
     verifyResponse.PositiveTesting(response)
     json_data = json.loads(response.text)
     AddFavMachineTest.oid = str(json_data.get("data").get("_id"))
Exemple #18
0
    def runTest(self):
        url = Baseurl + "update"
        print "--------------------------------------------------------------------------------------------------------"
        print "Calling API :" + url + " For Update Machine test"
        payload = {
            "_id": {
                "oid": AddMachineTest.oid
            },
            "machine_name":
            "UnitTestMachine",
            "host":
            "vptestind01",
            "ip":
            "10.19.87.107",
            "username":
            "******",
            "shell_type":
            "",
            "reload_command":
            "",
            "tag": [],
            "auth_type":
            "password",
            "machine_type":
            str(
                MachineTypeDb.get_machine_type_by_name("Production").get(
                    "_id")),
            "password":
            "******",
            "port":
            22,
            "account_id":
            str(AccountsDb.get_account_by_name("Test").get("_id")),
            "permitted_teams": [],
            "included_in": [],
            "steps_to_auth": []
        }

        response = requests.request("PUT",
                                    url,
                                    data=json.dumps(payload),
                                    headers=header,
                                    verify=False)
        verifyResponse.PositiveTesting(response)
Exemple #19
0
    def runTest(self):
        url = Baseurl + "update"
        print "--------------------------------------------------------------------------------------------------------"
        print "Calling API :" + url + " For Update ToolSet test"
        payload = {
            "_id": {
                "oid": AddToolSetTest.ToolSetoid
            },
            "name":
            "UnitTestToolSetTest",
            "description":
            "will describe later",
            "tag": [],
            "logo":
            "/static/files/logos/default_u.png",
            "tool_set": [{
                "tool_id": AddToolSetTest.Tooloid1,
                "status": "1",
                "tool_name": "UnitTestTool2",
                "version_name": "1",
                "version_id": AddToolSetTest.Veroid1,
                "version_number": "TEST",
                "tool_version": "UnitTestTool2 TEST"
            }, {
                "tool_id": AddToolSetTest.Tooloid2,
                "status": "1",
                "tool_name": "UnitTestTool3",
                "version_name": "1",
                "version_id": AddToolSetTest.Veroid2,
                "version_number": "TEST",
                "tool_version": "UnitTestTool3 TEST"
            }]
        }

        response = requests.request("PUT",
                                    url,
                                    data=json.dumps(payload),
                                    headers=header,
                                    verify=False)
        verifyResponse.PositiveTesting(response)
Exemple #20
0
    def runTest(self):
        url = Baseurl + "add"
        print "--------------------------------------------------------------------------------------------------------"
        print "Calling API :" + url + " For Create tool test"
        payload = {
            "name": "UnitTestTool",
            "tag": [],
            "support_details": "*****@*****.**",
            "description": "TEST",
            "version": {
                "version_date": "2018-02-16 14:44:47.021 ",
                "version_name": "1",
                "version_number": "TEST",
                "pre_requiests": [],
                "branch_tag": "Branch",
                "gitlab_repo": "",
                "gitlab_branch": "",
                "jenkins_job": "",
                "document": {
                    "documents": []
                },
                "backward_compatible": "no",
                "release_notes": "",
                "mps_certified": [],
                "deployment_field": {
                    "fields": []
                },
                "dependent_tools": []
            }
        }

        response = requests.request("POST",
                                    url,
                                    data=json.dumps(payload),
                                    headers=header,
                                    verify=False)
        verifyResponse.PositiveTesting(response)
        json_data = json.loads(response.text)
        AddToolTest.oid = str(json_data.get("data").get("_id"))
        AddToolTest.version_id = str(json_data.get("data").get("version_id"))
 def runTest(self):
     CreateDuForDuSet()
     url = Baseurl + "new"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Create DuSet test"
     payload = {
         "du_set": [{
             "du_id": AddDuSetTest.Duoid1,
             "dependent": "false",
             "order": 1
         }, {
             "du_id": AddDuSetTest.Duoid2,
             "dependent": "false",
             "order": 2
         }],
         "name":
         "UnitTestDuSet",
         "tag": [],
         "release_notes":
         "",
         "pre_requiests": [],
         "approval_status":
         "Created",
         "approval_list": [{
             "approval_status": "Created",
             "approved_by": "SuperAdmin",
             "approved_date": "2018-02-20T15:21:38.199Z"
         }]
     }
     response = requests.request("POST",
                                 url,
                                 data=json.dumps(payload),
                                 headers=header,
                                 verify=False)
     verifyResponse.PositiveTesting(response)
     json_data = json.loads(response.text)
     AddDuSetTest.DuSetoid = str(json_data.get("data").get("_id"))
Exemple #22
0
 def runTest(self):
     CreateToolForToolSet()
     url = Baseurl + "add"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Create ToolSet test"
     payload = {
         "tool_set": [{
             "tool_id": AddToolSetTest.Tooloid1,
             "status": "1",
             "tool_name": "UnitTestTool2",
             "tool_version": "UnitTestTool2 TEST",
             "version_id": AddToolSetTest.Veroid1,
             "version_name": "1",
             "version_number": "TEST"
         }, {
             "tool_id": AddToolSetTest.Tooloid2,
             "status": "1",
             "tool_name": "UnitTestTool3",
             "tool_version": "UnitTestTool3 TEST",
             "version_id": AddToolSetTest.Veroid2,
             "version_name": "1",
             "version_number": "TEST"
         }],
         "name":
         "UnitTestToolSetTest",
         "description":
         "",
         "tag": []
     }
     response = requests.request("POST",
                                 url,
                                 data=json.dumps(payload),
                                 headers=header,
                                 verify=False)
     verifyResponse.PositiveTesting(response)
     json_data = json.loads(response.text)
     AddToolSetTest.ToolSetoid = str(json_data.get("data").get("_id"))
 def runTest(self):
     url=Baseurl+"view/name/UnitTestMachineGroup"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :"+url + " For Get by Name MachineGroup test"
     response = requests.request("GET", url, headers=header,verify=False)
     verifyResponse.PositiveTesting(response)               
 def runTest(self):
     url = Baseurl + "search/name/TestDU"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Get by Name Du test"
     response = requests.request("GET", url, headers=header, verify=False)
     verifyResponse.PositiveTesting(response)
 def runTest(self):
     url = Baseurl + "search/tag/testtagforunittest"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Get by Tag Du test"
     response = requests.request("GET", url, headers=header, verify=False)
     verifyResponse.PositiveTesting(response)
Exemple #26
0
 def runTest(self):
     url = Baseurl + "search/name/" + AddMachineTest.machine_name
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Search Machine by name"
     response = requests.request("GET", url, headers=header, verify=False)
     verifyResponse.PositiveTesting(response)
Exemple #27
0
 def runTest(self):
     url = Baseurl + "type/all"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Get all type Machine test"
     response = requests.request("GET", url, headers=header, verify=False)
     verifyResponse.PositiveTesting(response)
Exemple #28
0
 def runTest(self):
     url = Baseurl + "view/" + AddMachineTest.oid
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :" + url + " For Get by Id Machine test"
     response = requests.request("GET", url, headers=header, verify=False)
     verifyResponse.PositiveTesting(response)
Exemple #29
0
 def runTest(self):
     url=Baseurl+"all"
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :"+url + " For Get all Deployment Group Request test"
     response = requests.request("GET", url, headers=header,verify=False)
     verifyResponse.PositiveTesting(response)                
Exemple #30
0
 def runTest(self):
     url=Baseurl+"saved/view/"+AddDepGroupReqTest.oid
     print "--------------------------------------------------------------------------------------------------------"
     print "Calling API :"+url + " For Get by Id Saved Deployment Group Request test"
     response = requests.request("GET", url, headers=header,verify=False)
     verifyResponse.PositiveTesting(response)