-
Notifications
You must be signed in to change notification settings - Fork 0
/
UserKeywords.robot
75 lines (65 loc) · 2.55 KB
/
UserKeywords.robot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
*** Settings ***
Variables UserDefinedVariables.py
Library Collections
Library ProtocolTesterLib.py
Library DoorTesterLib.py ${HOST}
Library FileTesterLib.py
*** Keywords ***
REMOVE FILE WITH CLIENT AND PROTOCOL
[Arguments] ${CLIENT} ${PROTOCOL} ${REMOTE_FILE} ${EXTRA_ARGUMENTS}=${EMPTY} ${PROTOCOL_PORT}=-1
SET CLIENT ${CLIENT}
${PORT}= SET VARIABLE ${PROTOCOL_PORT}
${PORT}= RUN KEYWORD IF ${PROTOCOL_PORT} < 0 GET FROM DICTIONARY ${PROTOCOL_PORTS} ${PROTOCOL}
SET PROTOCOL ${PROTOCOL} ${PORT}
SET HOST ${HOST}
SET EXTRA ARGUMENTS ${EXTRA_ARGUMENTS}
REMOVE REMOTE FILE ${REMOTE_FILE}
COMMAND SHOULD EXECUTE SUCCESSFULLY
CHECK IF DOORS ARE OPEN
[Arguments] ${PROTOCOL_DOORS}
${PROTOCOL_DOOR_PAIRS}= GET DICTIONARY ITEMS ${PROTOCOL_PORTS}
FOR ${PROTOCOL} ${DOOR} IN @{PROTOCOL_DOOR_PAIRS}
TEST PROTOCOL DOOR ${PROTOCOL} ${DOOR}
END
REMOVE LOCAL FILES WITH NAMES CONTAINING
[Arguments] ${FILE_NAME_ID}
@{FILES_IN_DIR}= LIST FILES IN DIRECTORY ${LOCAL_DIR} pattern=${FILE_NAME_ID}*
FOR ${FILE} IN @{FILES_IN_DIR}
REMOVE FILE ${FILE}
END
REMOVE REMOTE FILES WITH NAMES CONTAINING
[Arguments] ${FILE_NAME_ID}
SET CLIENT srmls
SET HOST ${HOST}
${PORT}= GET FROM DICTIONARY ${PROTOCOL_PORTS} srm
SET PROTOCOL srm ${PORT}
${FILES_IN_DIR}= GET REMOTE FILES LIST ${REMOTE_DIR}
${MATCHED_FILES}= GET MATCHES ${FILES_IN_DIR} *${FILE_NAME_ID}*
FOR ${FILE} IN @{MATCHED_FILES}
REMOVE FILE WITH CLIENT AND PROTOCOL srmrm srm ${FILE}
END
REMOVE DIRECTORY WITH CLIENT AND PROTOCOL
[Arguments] ${CLIENT} ${PROTOCOL} ${REMOTE_DIR} ${EXTRA_ARGUMENTS}=${EMPTY} ${PROTOCOL_PORT}=-1
SET CLIENT ${CLIENT}
SET HOST ${HOST}
${PORT}= SET VARIABLE ${PROTOCOL_PORT}
${PORT}= RUN KEYWORD IF ${PROTOCOL_PORT} < 0 GET FROM DICTIONARY ${PROTOCOL_PORTS} ${PROTOCOL}
SET PROTOCOL ${PROTOCOL} ${PORT}
SET EXTRA ARGUMENTS ${EXTRA_ARGUMENTS}
REMOVE REMOTE DIRECTORY ${REMOTE_DIR}
COMMAND SHOULD EXECUTE SUCCESSFULLY
REMOVE REMOTE DIRECTORIES WITH NAMES CONTAINING
[Arguments] ${DIR_NAME_ID}
SET CLIENT srmls
SET HOST ${HOST}
${PORT}= GET FROM DICTIONARY ${PROTOCOL_PORTS} srm
SET PROTOCOL srm ${port}
${DIRS_IN_DIR}= GET REMOTE DIRECTORIES LIST ${REMOTE_DIR}
${MATCHED_DIRS}= GET MATCHES ${DIRS_IN_DIR} *${DIR_NAME_ID}*
FOR ${DIR} IN @{MATCHED_DIRS}
REMOVE DIRECTORY WITH CLIENT AND PROTOCOL srmrmdir srm ${DIR}
END
REMOVE LOCAL AND REMOTE FILES WITH NAMES CONTAINING
[Arguments] ${LOCAL_FILE_ID} ${REMOTE_FILE_ID}
REMOVE LOCAL FILES WITH NAMES CONTAINING ${LOCAL_FILE_ID}
REMOVE REMOTE FILES WITH NAMES CONTAINING ${REMOTE_FILE_ID}