Ejemplo n.º 1
0
 def test_GetNetworkProfileList(self):
     '''
     @summary: 获取网络的配置集列表
     '''
     self.nwproapi = NetworkProfilesAPIs()
     LogPrint().info("Test: To get all NetworkProfiles list.")
     r = self.nwproapi.getNetworkProfileList(self.nw_id)
     if r['status_code']==self.dm.expected_status_code:
         LogPrint().info('PASS: Get NetworkProfile list SUCCESS.')
         self.flag = True
     else:
         LogPrint().error('FAIL: Get Network Profile list FAIL. Returned status code "%s" is WRONG.' % r['status_code'])
         self.flag = False
     self.assertTrue(self.flag)
Ejemplo n.º 2
0
 def test_GetNetworkProfileInfo(self):
     '''
     @summary: 获取网络的配置集信息
     @note: 操作成功,验证返回码和接口信息
     '''
     self.nwproapi = NetworkProfilesAPIs()
     LogPrint().info("Test: Get network %s's profile %s info." % (self.dm.nw_name, self.dm.profile_name))
     r = self.nwproapi.getNetworkProfileInfo(self.nw_id, self.dm.profile_name)
     if r['status_code']==self.dm.expected_status_code:
         dict_actual = r['result']
         dict_expected = xmltodict.parse((self.dm.profile_info %self.nw_id))
         dictCompare = DictCompare()
         if dictCompare.isSubsetDict(dict_expected, dict_actual):
             LogPrint().info("PASS: Get network %s's profile %s info SUCCESS." % (self.dm.nw_name, self.dm.profile_name) )
             self.flag = True
         else:
             LogPrint().error("FAIL: Returned messages are INCORRECT.")
             self.flag = False
     else:
         LogPrint().error("FAIL: Get NetworkProfile Info FAILED. Returned status code '%s' is WRONG." % r['status_code'] )
         self.flag = False
     self.assertTrue(self.flag)