-
Notifications
You must be signed in to change notification settings - Fork 0
/
SrmcpTests.robot
99 lines (86 loc) · 3.76 KB
/
SrmcpTests.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
*** Settings ***
Variables UserDefinedVariables.py
Resource UserKeywords.robot
Library String
Library OperatingSystem
Library Collections
Library DoorTesterLib.py ${HOST}
Library ProtocolTesterLib.py
Library FileTesterLib.py
Suite Setup TEST PROTOCOL DOOR ${PROTOCOL} ${PORT}
Suite Teardown REMOVE LOCAL AND REMOTE FILES WITH NAMES CONTAINING localfile remotefile
*** Variables ***
${CLIENT} srmcp
${PROTOCOL} srm
${PORT} ${PROTOCOL_PORTS}[${PROTOCOL}]
*** Test Cases ***
COPY MD5
[Documentation] Copy a file and use md5 for the checksum. After copying it back it should still be the same
SET CLIENT ${CLIENT}
SET PROTOCOL ${PROTOCOL} ${PORT}
SET HOST ${HOST}
SET EXTRA ARGUMENTS -cksm_type=MD5 -retry_num=0
${FILE_NAME}= REPLACE STRING ${TEST NAME} ${SPACE} ${EMPTY}
CREATE FILE ${LOCAL_FILE}${FILE_NAME} This is a testfile for ${TEST NAME}
COPY LOCAL FILE ${LOCAL_FILE}${FILE_NAME} ${REMOTE_FILE}${FILE_NAME}
COMMAND SHOULD EXECUTE SUCCESSFULLY
SET EXTRA ARGUMENTS -retry_num=0
COPY REMOTE FILE ${REMOTE_FILE}${FILE_NAME} ${LOCAL_FILE}${FILe_NAME}1
COMMAND SHOULD EXECUTE SUCCESSFULLY
FILES SHOULD BE THE SAME ${LOCAL_FILE}${FILE_NAME} ${LOCAL_FILE}${FILE_NAME}1 hash_type=md5
COPY BAD CHECKSUM MD5
[Documentation] Copies a file from which the content (and thus checksum calculated with md5) changes during the copy call (/proc/uptime).
SET CLIENT ${CLIENT}
SET PROTOCOL ${PROTOCOL} ${PORT}
SET HOST ${HOST}
SET EXTRA ARGUMENTS -cksm_type=MD5 -retry_num=0
${FILE_NAME}= REPLACE STRING ${TEST NAME} ${SPACE} ${EMPTY}
COPY LOCAL FILE /proc/uptime ${REMOTE_FILE}${FILE_NAME}
ERROR SHOULD CONTAIN Checksum mismatch
COPY BAD CHECKSUM
[Documentation] Copies a file from which the content (and thus checksum) changes during the copy call (/proc/uptime)
SET CLIENT ${CLIENT}
SET PROTOCOL ${PROTOCOL} ${PORT}
SET HOST ${HOST}
SET EXTRA ARGUMENTS -retry_num=0
${FILE_NAME}= REPLACE STRING ${TEST_NAME} ${SPACE} ${EMPTY}
COPY LOCAL FILE /proc/uptime ${REMOTE_FILE}${FILE_NAME}
ERROR SHOULD CONTAIN Checksum mismatch
COPY DIR NOT EXIST
[Documentation] Copies a file to a directory that doesn't exist yet. This should create the directory on the fly
SET CLIENT ${CLIENT}
SET PROTOCOL ${PROTOCOL} ${PORT}
SET HOST ${HOST}
SET EXTRA ARGUMENTS -retry_num=0
${FILE_NAME}= REPLACE STRING ${TEST NAME} ${SPACE} ${EMPTY}
CREATE FILE ${LOCAL_FILE}${FILE_NAME} This is a testfile for ${TEST NAME}
COPY LOCAL FILE ${LOCAL_FILE}${FILE_NAME} ${REMOTE_FILE}/${FILE_NAME}
COMMAND SHOULD EXECUTE SUCCESSFULLY
COPY REMOTE FILE ${REMOTE_FILE}/${FILE_NAME} ${LOCAL_FILE}${FILE_NAME}1
COMMAND SHOULD EXECUTE SUCCESSFULLY
FILES SHOULD BE THE SAME ${LOCAL_FILE}${FILE_NAME} ${LOCAL_FILE}${FILE_NAME}1
SET CLIENT srmrm
REMOVE REMOTE FILE ${REMOTE_FILE}/${FILE_NAME}
COMMAND SHOULD EXECUTE SUCCESSFULLY
SET CLIENT srmrmdir
REMOVE REMOTE DIRECTORY ${REMOTE_FILE}
COMMAND SHOULD EXECUTE SUCCESSFULLY
COPY HTTP
[Documentation] Copy a file using srm and then copy it with http to srm on the same host again.
[Tags] broken_on_srmV1
SET CLIENT ${CLIENT}
SET PROTOCOL ${PROTOCOL} ${PORT}
SET HOST ${HOST}
SET EXTRA ARGUMENTS -retry_num=0
${FILE_NAME}= REPLACE STRING ${TEST NAME} ${SPACE} ${EMPTY}
CREATE FILE ${LOCAL_FILE}${FILE_NAME} This is a testfile for ${TEST NAME}
COPY LOCAL FILE ${LOCAL_FILE}${FILE_NAME} ${REMOTE_FILE}${FILE_NAME}
COMMAND SHOULD EXECUTE SUCCESSFULLY
SET PROTOCOL http ${PROTOCOL_PORTS}[http] ${PROTOCOL} ${PORT}
SET HOST ${HOST} ${HOST}
COPY REMOTE TO REMOTE ${REMOTE_FILE}${FILE_NAME} ${REMOTE_FILE}${FILE_NAME}1
COMMAND SHOULD EXECUTE SUCCESSFULLY
SET PROTOCOL ${PROTOCOL} ${PORT}
COPY REMOTE FILE ${REMOTE_FILE}${FILE_NAME}1 ${LOCAL_FILE}${FILE_NAME}1
COMMAND SHOULD EXECUTE SUCCESSFULLY
FILES SHOULD BE THE SAME ${LOCAL_FILE}${FILE_NAME} ${LOCAL_FILE}${FILE_NAME}1