Skip to content

Commit d7bc624

Browse files
Merge pull request #12 from att/openoffload
Add Activation to robot discrete tests
2 parents aea14df + 06b9b7d commit d7bc624

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

tests/basic/sessions_client.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,20 @@ def run_get_all_sessions():
225225
statsStub = openoffload_pb2_grpc.SessionStatisticsTableStub(statsChannel)
226226
print("-------------- Get All Sessions --------------")
227227
session_getAllSessions(statsStub)
228+
229+
def run_activation_sequence():
230+
with open('ssl/server.crt', 'rb') as f:
231+
creds = grpc.ssl_channel_credentials(f.read())
232+
activationChannel = grpc.secure_channel('localhost:3445',creds)
233+
activationStub = openoffload_pb2_grpc.ActivationStub(activationChannel)
234+
print("\n\n------------Creating new devices---------------------\n")
235+
activation_registerDevice(activationStub)
236+
print("\n------------- Listing available Devices --------------------\n")
237+
activation_getAllDevices(activationStub)
238+
print("\n------------- Activating Device --------------------\n")
239+
activation_activateDevice(activationStub)
240+
print("\n------------- Activation Tests Complete --------------------\n")
241+
228242
def run():
229243
# NOTE(gRPC Python Team): openoffload_pb2.close() is possible on a channel and should be
230244
# used in circumstances in which the with statement does not fit the needs

tests/robot/src/test/robotframework/acceptance/pythonBasicTests.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Get Closed Sessions Test
2424
Run Get Closed Sessions
2525
Get All Closed Sessions Test
2626
Run Get All Sessions
27+
Activation Tests
28+
Run Activation Sequence
2729
Suite Teardown
2830
Stop Activation Server
2931
Stop Stats Server

tests/robot/src/test/robotframework/acceptance/resources/python/basic.robot

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ Run Get All Sessions
9898
Should Contain ${result.stdout} SessionId: 1002
9999
Should Contain ${result.stdout} CLOSED
100100

101+
Run Activation Sequence
102+
[Documentation] Run Activation Sequence
103+
Run Process python -c import sessions_client; sessions_client.run_activation_sequence(); cwd=${projectRoot}/../buildBasic alias=client
104+
${result} = Get Process Result client
105+
Log ${result.stderr}
106+
Log ${result.stdout}
107+
Should Contain ${result.stdout} Status: _DEVICE_REGISTERED
108+
Should Contain ${result.stdout} Description: Acme SmartNIC
109+
Should Contain ${result.stdout} Status: _DEVICE_ACTIVATED
110+
101111
Stop Offload Server
102112
[Documentation] Stop Offload Server
103113
Terminate Process offload

0 commit comments

Comments
 (0)