Skip to content

Commit 7a52507

Browse files
authored
Merge pull request #18 from OpenIxia/9.37
Modify the topology arguments and variables
2 parents ddc54f1 + b70cecd commit 7a52507

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

.DS_Store

0 Bytes
Binary file not shown.

RestApi/.DS_Store

0 Bytes
Binary file not shown.

RestApi/Python/.DS_Store

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

RestApi/Python/RestApi_v2/Modules/bps_restpy/rest_samples/s15_aps400_AppSim_fanout.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@
3434

3535

3636
slot_number = 1
37-
port_list = [3, 4]
38-
port_list_postFanout = [3,4]
37+
port_list = [3.0,4.0]
38+
port_list_postFanout = [3.2,4.2]
3939
l47_resource = [2,3]
40+
testGroup = 2
4041

4142
########################################
4243

@@ -56,7 +57,7 @@
5657
bps.administration.userSettings.changeUserSetting("autoreserve.l47","0")
5758
########################################
5859
print("Fanout the ports")
59-
fanout_result = bps.topology.getPortAvailableModes(slot_number, 40)
60+
fanout_result = bps.topology.getPortAvailableModes(slot_number, port_list[0])
6061
print("The list of Fanout options:")
6162
for li in fanout_result["modes"]:
6263
print("The available fanout mode {0}".format(li["name"]))
@@ -93,17 +94,16 @@
9394
print("All ports fanout completed!")
9495
time.sleep(3)
9596
#######################################
96-
print("Reserve L47 resources...")
97-
for r in l47_resource:
98-
bps.topology.reserveResource(group = 2, resourceId = r, resourceType = "l47")
99-
10097
print("Reserve Ports")
101-
for p in port_list:
102-
bps.topology.reserve([{'slot': slot_number, 'port': p, 'group': 2}])
98+
for p in port_list_postFanout:
99+
bps.topology.reserve([{'slot': slot_number, 'port': p, 'group': testGroup}])
103100

101+
print("Reserve L47 resources...")
102+
for r in l47_resource:
103+
bps.topology.reserveResource(group = testGroup, resourceId = r, resourceType = "l47")
104104
########################################
105105
print("Run test and Get Stats:")
106-
test_id_json = bps.testmodel.run(modelname=canned_test_name, group=2)
106+
test_id_json = bps.testmodel.run(modelname=canned_test_name, group=testGroup)
107107
testid = str( test_id_json["runid"] )
108108
run_id = 'TEST-' + testid
109109
print("Test Run Id: %s"%run_id)
@@ -129,13 +129,13 @@
129129
tabledata = bps.reports.getReportTable(runid=testid, sectionId="3.4")
130130
pp(tabledata)
131131

132+
print ("Unreserving the ports")
133+
for p in port_list_postFanout:
134+
bps.topology.unreserve([{'slot': slot_number, 'port': p, 'group': testGroup}])
135+
132136
print("Releasing resources...")
133137
for r in l47_resource:
134-
bps.topology.releaseResource(group = 2, resourceId = r, resourceType = "l47")
135-
136-
print ("Unreserving the ports")
137-
for p in port_list:
138-
bps.topology.unreserve([{'slot': slot_number, 'port': p, 'group': 2}])
138+
bps.topology.releaseResource(group = testGroup, resourceId = r, resourceType = "l47")
139139

140140
bps.logout()
141141

0 commit comments

Comments
 (0)