transfersh

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 transfersh’s official test suite, and the transfersh project is not affiliated with atago.

Summary #

1 suite · 3 scenarios

Contents #

transfer.sh (self-hosted file sharing) #

transfer.sh takes a file and gives you a URL to fetch it back from. The only guarantee that matters is that what comes back is what went in.

So this suite tests it with binary data rather than text. A PNG is uploaded as a raw request body, the share URL is captured from the response, the file is downloaded back to disk, and the bytes are compared to the original — both as a valid image and byte for byte. Text survives a lot of accidental mangling that binary does not.

The browser-style multipart upload path is exercised as well, since that is how a file arrives from a web form rather than from curl.

Source: test/e2e/thirdparty/transfersh/transfersh.atago.yaml Network policy: egress is allowed only to 127.0.0.1.

Scenario: the binary reports its version #

only when command -v transfer.sh succeeds

When #

transfer.sh version

Then #

  • exit code is 0
  • stdout contains transfer.sh

Scenario: a binary upload round-trips byte-for-byte #

only when command -v transfer.sh succeeds

Given #

  • Background service transfersh is started: transfer.sh --provider local --basedir storage --temp-path tmp --listener 127.0.0.1:18210.
  • Fixture file storage/.keep is created.
  • Fixture file tmp/.keep is created.
  • Fixture file pixel.png is created.

When #

# HTTP PUT /pixel.png via share
# capture ${share_url} from the response body
# HTTP GET ${share_url} via share
cmp pixel.png downloaded.png

Then #

  • after HTTP PUT /pixel.png:
    • HTTP status is 200
    • body contains http://127.0.0.1:18210/
  • after HTTP GET ${share_url}:
    • HTTP status is 200
    • image downloaded.png is png, width 1, height 1
  • after cmp pixel.png downloaded.png:
    • exit code is 0

Generated artifacts #

  • downloaded.png

Scenario: a browser-style multipart upload is accepted too #

only when command -v transfer.sh succeeds

Given #

  • Background service transfersh is started: transfer.sh --provider local --basedir storage --temp-path tmp --listener 127.0.0.1:18211.
  • Fixture file storage/.keep is created.
  • Fixture file tmp/.keep is created.
  • Fixture file notes.txt is created.

Inputs #

Fixture notes.txt:

shared through a multipart form

When #

# HTTP POST / via share2
# capture ${share_url} from the response body
# HTTP GET ${share_url} via share2
# HTTP GET /no-such-token/notes.txt via share2

Then #

  • after HTTP POST /:
    • HTTP status is 200
    • body contains http://127.0.0.1:18211/
  • after HTTP GET ${share_url}:
    • HTTP status is 200
    • body contains shared through a multipart form
  • after HTTP GET /no-such-token/notes.txt:
    • HTTP status is 404