File tree Expand file tree Collapse file tree 3 files changed +36
-4
lines changed Expand file tree Collapse file tree 3 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ ${INTERPRETER} python
8
8
9
9
*** Keywords ***
10
10
Start And Import Remote Library
11
- [Arguments] ${library }
11
+ [Arguments] ${library } ${ name } =Remote
12
12
Set Pythonpath
13
13
${port } = Start Remote Library ${library }
14
- Import Library Remote http://127.0.0.1:${port }
14
+ Import Library Remote http://127.0.0.1:${port } WITH NAME ${ name }
15
15
Set Suite Variable ${ACTIVE PORT } ${port }
16
16
Set Log Level DEBUG
17
17
@@ -46,3 +46,4 @@ Server Should Be Stopped And Correct Messages Logged
46
46
... Robot Framework remote server at 127.0.0.1:${ACTIVE PORT } starting.
47
47
... Robot Framework remote server at 127.0.0.1:${ACTIVE PORT } stopping.
48
48
Should Be Equal ${result.stdout } ${expected }
49
+ Should Be Equal ${result.rc } ${0 }
Original file line number Diff line number Diff line change
1
+ *** Settings ***
2
+ Resource resource.robot
3
+ Test Setup Start Server
4
+ Test Teardown Server Should Be Stopped
5
+
6
+ *** Test Cases ***
7
+ Stop Remote Server
8
+ Stop Remote Server
9
+
10
+ SIGINT
11
+ Send Signal To Process SIGINT
12
+
13
+ SIGHUP
14
+ Send Signal To Process SIGHUP
15
+
16
+ *** Keywords ***
17
+ Start Server
18
+ Start And Import Remote Library basics.py ${TEST NAME }
19
+ Server Should Be Started
20
+
21
+ Server Should Be Started
22
+ Run Keyword ${TEST NAME } .Passing
23
+
24
+ Server Should Be Stopped
25
+ Server Should Be Stopped And Correct Messages Logged
26
+ Run Keyword And Expect Error Connection to remote server broken: *
27
+ ... Server Should Be Started
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ def _register_signal_handlers(self):
62
62
def stop_with_signal (signum , frame ):
63
63
self ._allow_stop = True
64
64
self .stop_remote_server ()
65
+ raise KeyboardInterrupt
65
66
if hasattr (signal , 'SIGHUP' ):
66
67
signal .signal (signal .SIGHUP , stop_with_signal )
67
68
if hasattr (signal , 'SIGINT' ):
@@ -79,8 +80,11 @@ def _announce_start(self, port_file=None):
79
80
pf .close ()
80
81
81
82
def serve_forever (self ):
82
- while not self ._shutdown :
83
- self .handle_request ()
83
+ try :
84
+ while not self ._shutdown :
85
+ self .handle_request ()
86
+ except KeyboardInterrupt :
87
+ pass
84
88
85
89
def stop_remote_server (self ):
86
90
prefix = 'Robot Framework remote server at %s:%s ' % self .server_address
You can’t perform that action at this time.
0 commit comments