X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2FtestInterfaces.py;h=ce729367b4be426af457595824644f74091a91e9;hb=89d0fa4efde57cb62445af75c16bdc42bc03693a;hp=4aa905a9350e4fe7c4d757cb7b914d99df0d3c6e;hpb=5307e4e09dd0a7982f0c6dfdd13065425c802005;p=sfa.git diff --git a/tests/testInterfaces.py b/tests/testInterfaces.py index 4aa905a9..ce729367 100755 --- a/tests/testInterfaces.py +++ b/tests/testInterfaces.py @@ -4,16 +4,14 @@ import os import random import string import unittest -import sfa.util.xmlrpcprotocol as xmlrpc +import sfa.util.xmlrpcprotocol as xmlrpcprotocol from unittest import TestCase from optparse import OptionParser -from sfa.util.xmlrpcprotocol import ServerException from sfa.util.xrn import get_authority from sfa.util.config import * from sfa.trust.certificate import * from sfa.trust.credential import * -from sfa.util.sfaticket import * -from sfa.util.rspec import * +from sfa.trust.sfaticket import SfaTicket from sfa.client import sfi def random_string(size): @@ -45,10 +43,10 @@ class Client: self.cert.save_to_file(cert_file) SFI_AGGREGATE = config.SFI_SM.replace('12347', '12346') SFI_CM = 'http://' + options.cm_host + ':12346' - self.registry = xmlrpc.get_server(config.SFI_REGISTRY, key_file, cert_file) - self.aggregate = xmlrpc.get_server(SFI_AGGREGATE, key_file, cert_file) - self.sm = xmlrpc.get_server(config.SFI_SM, key_file, cert_file) - self.cm = xmlrpc.get_server(SFI_CM, key_file, cert_file) + self.registry = xmlrpcprotocol.server_proxy(config.SFI_REGISTRY, key_file, cert_file) + self.aggregate = xmlrpcprotocol.server_proxy(SFI_AGGREGATE, key_file, cert_file) + self.sm = xmlrpcprotocol.server_proxy(config.SFI_SM, key_file, cert_file) + self.cm = xmlrpcprotocol.server_proxy(SFI_CM, key_file, cert_file) self.hrn = config.SFI_USER # XX defaulting to user, but this should be configurable so we can # test from components persepctive @@ -172,7 +170,7 @@ class RegistryTest(BasicTestCase): server_exception = False try: callable(self.credential) - except ServerException: + except xmlrpcprotocol.ServerException: server_exception = True finally: if self.type in ['user'] and not server_exception: @@ -184,7 +182,7 @@ class AggregateTest(BasicTestCase): BasicTestCase.setUp(self) def testGetSlices(self): - self.aggregate.get_slices(self.credential) + self.aggregate.ListSlices(self.credential) def testGetResources(self): # available resources @@ -240,7 +238,7 @@ class ComponentTest(BasicTestCase): self.cm.restart_slice(self.slice_cred, self.slice['hrn']) def testGetSlices(self): - self.cm.get_slices(self.slice_cred, self.slice['hrn']) + self.cm.ListSlices(self.slice_cred, self.slice['hrn']) def testRedeemTicket(self): rspec = self.aggregate.get_resources(self.credential)