From 46bea38612245a28af8e5daaf76544f25ec74d90 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 18 Jul 2021 09:49:04 +0300 Subject: test: add scenario to verify chunkify works Sponsored-by: author --- obnam.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'obnam.md') diff --git a/obnam.md b/obnam.md index 181b2c2..31b87dd 100644 --- a/obnam.md +++ b/obnam.md @@ -1129,7 +1129,7 @@ given an installed obnam and file config.yaml and JSON file config.json converted from YAML file config.yaml when I run obnam --config config.yaml config -then stdout, as JSON, matches file config.json +then stdout, as JSON, has all the values in file config.json ~~~ ~~~{#config.yaml .file .yaml .numberLines} @@ -1216,6 +1216,34 @@ then files cleartext.dat and encrypted.dat are different then files cleartext.dat and decrypted.dat are identical ~~~ +## Split a file into chunks + +The `obnam chunkify` command reads one or more files and splits them +into chunks, and writes to the standard output a JSON file describing +each chunk. This scenario verifies that the command works at least in +a simple case. + +~~~scenario +given an installed obnam +given a running chunk server +given a client config based on smoke.yaml +given a file data.dat containing "hello, world" +given file chunks.json +when I run obnam chunkify data.dat +then stdout, as JSON, exactly matches file chunks.json +~~~ + +~~~{#chunks.json .file .json} +[ + { + "filename": "data.dat", + "offset": 0, + "len": 12, + "checksum": "09ca7e4eaa6e8ae9c7d261167129184883644d07dfba7cbfbc4c8a2e08360d5b" + } +] +~~~ + # Acceptance criteria for Obnam as a whole The scenarios in this chapter apply to Obnam as a whole: the client -- cgit v1.2.1