-#!/usr/bin/python
+#!/usr/bin/env python3
import sys
import os
import random
def __init__(self, options):
try: self.config = config = Config(options.config_file)
except:
- print "failed to read config_file %s" % options.config_file
+ print("failed to read config_file %s" % options.config_file)
sys.exit(1)
key_path = os.path.dirname(options.config_file)
user_name = self.config.SFI_USER.split('.')[-1:][0]
# will raise an exception if the ticket inst valid
SfaTicket(string=ticket)
-class ComponentTest(BasicTestCase):
- def setUp(self):
- BasicTestCase.setUp(self)
- self.slice_cred = self.client.GetCredential(self.slice['hrn'], 'slice')
-
- def testStartSlice(self):
- self.cm.start_slice(self.slice_cred, self.slice['hrn'])
-
- def testStopSlice(self):
- self.cm.stop_slice(self.slice_cred, self.slice['hrn'])
-
- def testDeleteSlice(self):
- self.cm.DeleteSliver(self.slice_cred, self.slice['hrn'],"call-id-delete-slice-cm")
-
- def testRestartSlice(self):
- self.cm.restart_slice(self.slice_cred, self.slice['hrn'])
-
- def testGetSlices(self):
- self.cm.ListSlices(self.slice_cred, self.slice['hrn'])
-
- def testRedeemTicket(self):
- rspec = self.aggregate.get_resources(self.credential)
- ticket = self.aggregate.GetTicket(slice_cred, self.slice['hrn'], rspec)
- self.cm.redeem_ticket(slice_cred, ticket)
-
-
def test_names(testcase):
return [name for name in dir(testcase) if name.startswith('test')]