-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests_dist.sh
More file actions
executable file
·51 lines (43 loc) · 1.74 KB
/
run_tests_dist.sh
File metadata and controls
executable file
·51 lines (43 loc) · 1.74 KB
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
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
#
# Copyright (C) 2025 CESNET.
#
# free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
set -e
cd dist
echo "runner: $RUNNER"
if [[ "$RUNNER" == "Windows" ]]; then SCRIPT_NAME="${SCRIPT_NAME}.exe"; fi
echo -ne " test: ${SCRIPT_NAME} --help\r"
set +e
read -r -d '' GOLDEN <<- EOT
usage: ${SCRIPT_NAME} [-h] [-d] [-c RCLONE_CONFIG] [-r RCLONE_COMMAND] [-p] [-v]
CESNET S3 rclone GUI config for users
options:
-h, --help show this help message and exit
-d, --debug enable debug outputs (default False)
-c RCLONE_CONFIG, --rclone_config RCLONE_CONFIG
rclone config file (default: None)
-r RCLONE_COMMAND, --rclone_command RCLONE_COMMAND
rclone command, could be full path to command (default: rclone)
-p, --password_command
run as rclone password command, for internal use
-v, --version print version and exit
EOT
set -e
#echo ">$GOLDEN<"
OUT="$(./${SCRIPT_NAME} --help)"
#echo ">$OUT<"
diff <(echo "$GOLDEN"| sed 's/optional arguments/options/' | tr '\n\t' ' ' | tr -s ' ') <(echo "$OUT" | sed 's/optional arguments/options/' | tr '\n\t' ' ' | tr -s ' ')
echo "OK"
echo -ne " test: ${SCRIPT_NAME} --password_command 0\r"
GOLDEN="abc"
OUT="$(PYGUI_RCLONE_OLDPW=abc PYGUI_RCLONE_NEWPW=def RCLONE_PASSWORD_CHANGE=0 ./${SCRIPT_NAME} --password_command)"
diff <(echo "$GOLDEN") <(echo "$OUT")
echo "OK"
echo -ne " test: ${SCRIPT_NAME} --password_command 1\r"
GOLDEN="def"
OUT="$(PYGUI_RCLONE_OLDPW=abc PYGUI_RCLONE_NEWPW=def RCLONE_PASSWORD_CHANGE=1 ./${SCRIPT_NAME} --password_command)"
diff <(echo "$GOLDEN") <(echo "$OUT")
echo "OK"