rclone
The atago project wrote these specs on its own initiative and runs them in its own CI, to exercise atago against a real program. They are not rclone’s official test suite, and the rclone project is not affiliated with atago.
Summary #
1 suite · 7 scenarios
Contents #
- rclone (self-hosted file sync program) — 7 scenarios
- version prints a semantic version
- copy replicates a tree and check certifies the replica
- check fails loudly once the replica is corrupted
- lsjson emits a machine-readable listing
- sync makes the destination mirror the source, deletions included
- obscure and reveal round-trip a secret
- serve http publishes the tree over real HTTP
rclone (self-hosted file sync program) #
Source: test/e2e/thirdparty/rclone/rclone.atago.yaml
Scenario: version prints a semantic version #
When #
rclone version
Then #
- exit code is
0 - stdout matches
/rclone v[0-9]+\.[0-9]+\.[0-9]+/
Scenario: copy replicates a tree and check certifies the replica #
Given #
- Fixture file
rclone.confis created. - Fixture file
src/hello.txtis created. - Fixture file
src/sub/table.csvis created.
Inputs #
Fixture src/hello.txt:
hello rclone
Fixture src/sub/table.csv:
a,b
1,2
When #
rclone copy src dst
rclone check src dst
Then #
- after
rclone copy src dst:- exit code is
0 - dir
dstcontainshello.txt, containssub/table.csv - file
dst/hello.txtcontainshello rclone
- exit code is
- after
rclone check src dst:- exit code is
0 - stderr contains
0 differences found
- exit code is
Scenario: check fails loudly once the replica is corrupted #
Given #
- Fixture file
rclone.confis created. - Fixture file
src/hello.txtis created. - Fixture file
dst/hello.txtis created.
Inputs #
Fixture src/hello.txt:
hello rclone
Fixture dst/hello.txt:
corrupted replica
When #
rclone copy src dst
rclone check src dst
Then #
- after
rclone check src dst:- exit code is not
0 - stderr contains
1 differences found
- exit code is not
Scenario: lsjson emits a machine-readable listing #
Given #
- Fixture file
rclone.confis created. - Fixture file
src/hello.txtis created. - Fixture file
src/sub/table.csvis created.
Inputs #
Fixture src/hello.txt:
hello rclone
Fixture src/sub/table.csv:
a,b
1,2
When #
rclone lsjson src
rclone size --json src
Then #
- after
rclone lsjson src:- exit code is
0 - stdout at
$has length 2 - stdout at
$[0].Nameequalshello.txt - stdout at
$[0].Sizeequals12 - stdout at
$[1].IsDirequalstrue
- exit code is
- after
rclone size --json src:- exit code is
0 - stdout at
$.countequals2
- exit code is
Scenario: sync makes the destination mirror the source, deletions included #
Given #
- Fixture file
rclone.confis created. - Fixture file
src/keep.txtis created. - Fixture file
dst/extraneous.txtis created.
Inputs #
Fixture src/keep.txt:
stays
Fixture dst/extraneous.txt:
must be deleted by sync
When #
rclone sync src dst
Then #
- exit code is
0 - dir
dstcontainskeep.txt, does not containextraneous.txt
Scenario: obscure and reveal round-trip a secret #
Given #
- Fixture file
rclone.confis created.
When #
rclone obscure atago-test-secret
# capture ${obscured} from stdout
rclone reveal ${obscured}
Then #
- after
rclone obscure atago-test-secret:- exit code is
0
- exit code is
- after
rclone reveal ${obscured}:- exit code is
0 - stdout equals an exact value
- exit code is
Scenario: serve http publishes the tree over real HTTP #
Given #
- Background service
rclone-httpis started:rclone serve http src --addr 127.0.0.1:18110. - Fixture file
rclone.confis created. - Fixture file
src/hello.txtis created. - Fixture file
src/api/data.jsonis created.
Inputs #
Fixture src/hello.txt:
hello over http
Fixture src/api/data.json:
{"source":"rclone","ok":true}
When #
# HTTP GET /hello.txt
# HTTP GET /api/data.json
# HTTP GET /no-such-file.txt
Then #
- after
HTTP GET /hello.txt:- HTTP status is
200 - body contains
hello over http
- HTTP status is
- after
HTTP GET /api/data.json:- HTTP status is
200 - body at
$.sourceequalsrclone
- HTTP status is
- after
HTTP GET /no-such-file.txt:- HTTP status is
404
- HTTP status is