Changeset View
Changeset View
Standalone View
Standalone View
smoketest/smoke.sh
- This file was added.
Property | Old Value | New Value |
---|---|---|
File Mode | null | 100755 |
1 | #!/bin/bash | ||||
---|---|---|---|---|---|
2 | # | ||||
3 | # Copyright (C) 2019 Harald Sitter <sitter@kde.org> | ||||
4 | # | ||||
5 | # This program is free software; you can redistribute it and/or | ||||
6 | # modify it under the terms of the GNU General Public License as | ||||
7 | # published by the Free Software Foundation; either version 3 of | ||||
8 | # the License or any later version accepted by the membership of | ||||
9 | # KDE e.V. (or its successor approved by the membership of KDE | ||||
10 | # e.V.), which shall act as a proxy defined in Section 14 of | ||||
11 | # version 3 of the license. | ||||
12 | # | ||||
13 | # This program is distributed in the hope that it will be useful, | ||||
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
16 | # GNU General Public License for more details. | ||||
17 | # | ||||
18 | # You should have received a copy of the GNU General Public License | ||||
19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
20 | | ||||
21 | set -e | ||||
22 | | ||||
23 | export KDE_FORK_SLAVES=1 | ||||
24 | | ||||
25 | # enter a valid localhost login here | ||||
26 | host=$1 | ||||
27 | if [ "$host" = "" ]; then | ||||
28 | echo "Need to pass base uri as argument... e.g. smb://foo/srv" | ||||
29 | exit 1 | ||||
30 | fi | ||||
31 | dir='kio_smoke_test' | ||||
32 | uri="$host/$dir" | ||||
33 | | ||||
34 | kioclient5 remove $uri || true | ||||
35 | kioclient5 copy $dir $uri | ||||
36 | | ||||
37 | # upload | ||||
38 | kioclient5 copy file1 $uri/file1 | ||||
39 | if [ "$(kioclient5 cat $uri/file1)" != "content1" ]; then | ||||
40 | echo "Reading file1 failed!" | ||||
41 | exit 1 | ||||
42 | fi | ||||
43 | | ||||
44 | # remote rename | ||||
45 | kioclient5 move $uri/file1 $uri/file2 | ||||
46 | if [ "$(kioclient5 cat $uri/file2)" != "content1" ]; then | ||||
47 | echo "Moving to file2 failed!" | ||||
48 | exit 1 | ||||
49 | fi | ||||
50 | | ||||
51 | if kioclient5 cat $uri/file1; then | ||||
52 | echo "Tried to move file1 to file2 but now both exist!" | ||||
53 | exit 1 | ||||
54 | fi | ||||
55 | | ||||
56 | # remote copy | ||||
57 | kioclient5 copy $uri/file2 $uri/file1 | ||||
58 | | ||||
59 | # both exist | ||||
60 | kioclient5 cat $uri/file1 | ||||
61 | kioclient5 cat $uri/file2 | ||||
62 | | ||||
63 | # remote remove | ||||
64 | kioclient5 remove $uri/file1 | ||||
65 | if kioclient5 cat $uri/file1; then | ||||
66 | echo "Tried to remove file1 but still exists!" | ||||
67 | exit 1 | ||||
68 | fi | ||||
69 | | ||||
70 | # ls | ||||
71 | kioclient5 ls $uri # not checking output, too lazy | ||||
72 | | ||||
73 | # download | ||||
74 | rm -rfv file2 | ||||
75 | kioclient5 copy $uri/file2 file://`pwd`/file2 # download | ||||
76 | if [ ! -e file2 ]; then | ||||
77 | echo "failed to download :(" | ||||
78 | exit 1 | ||||
79 | fi | ||||
80 | rm -rfv file2 | ||||
81 | | ||||
82 | # delete remote dir again | ||||
83 | kioclient5 remove $uri |