Beispiel #1
0
# bps_system  = '<BPS_BOX_IP/HOSTNAME>'
# bpsuser     = '******'
# bpspass     = '******'
bps_system = '10.36.83.135'
bpsuser = '******'
bpspass = '******'

mainLicenseServer = '10.36.83.135'
activationCode = 'E61B-A9F7-C4BE-01D9'

########################################

########################################
# Login to BPS box
bps = BPS(bps_system, bpsuser, bpspass)
bps.disablePrints(disable=False)
bps.login()

# create an instance of the BPSVELicenseManagement admin class
licenseMngr = BPSVELicenseManagement(bps)

# list license servers added
licenseServers = licenseMngr.getLicenseServers()
print("The following license servers are added: " + str(licenseServers))

# add desired server if not allready there
if not mainLicenseServer in [
        item['host'] for item in licenseServers if 'host' in item
]:
    licenseMngr.addLicenseServer(mainLicenseServer)
Beispiel #2
0
bpsuser = '******'
bpspass = '******'

slot_number = 4
port_list = [0, 1]
########################################

########################################

script_log = logging.getLogger(__name__)

########################################
# Login to BPS box
bps = BPS(bps_system, bpsuser, bpspass)
#disable module level output but still leave script level logs
bps.disablePrints(True)
script_log.setLevel(logging.INFO)
bps.login()
########################################
script_log.info("Load a canned test: ")
bps.testmodel.load(canned_test_name)

########################################
script_log.info("Reserve Ports")
for p in port_list:
    bps.topology.reserve([{'slot': slot_number, 'port': p, 'group': 2}])

########################################
script_log.info("Run test and Get Stats:")
test_id_json = bps.testmodel.run(modelname=canned_test_name, group=2)
testid = str(test_id_json["runid"])