From 076e92da04ea5e3c052947bbc403812a92aad0c2 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 15 Sep 2021 08:38:05 +0300 Subject: refactor: move document metadata to top My Emacs' markdown-mode no longer gets confused by this and it's clearer tot have it at the top. Sponsored-by: author --- obnam.md | 66 +++++++++++++++++++++++++++++----------------------------------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/obnam.md b/obnam.md index 1a24d7a..e314e6d 100644 --- a/obnam.md +++ b/obnam.md @@ -1,3 +1,33 @@ +--- +title: "Obnam2—a backup system" +author: Lars Wirzenius +documentclass: report +bindings: + - subplot/server.yaml + - subplot/client.yaml + - subplot/data.yaml + - lib/files.yaml + - lib/runcmd.yaml +template: python +functions: + - subplot/server.py + - subplot/client.py + - subplot/data.py + - lib/daemon.py + - lib/files.py + - lib/runcmd.py +classes: + - json +abstract: | + Obnam is a backup system, consisting of a not very smart server for + storing chunks of backup data, and a client that splits the user's + data into chunks. They communicate via HTTP. + + This document describes the architecture and acceptance criteria for + Obnam, as well as how the acceptance criteria are verified. +... + + # Introduction Obnam2 is a backup system. @@ -1803,39 +1833,3 @@ made, the passphrase is not stored in cleartext on the server. Verify that the backup repository does not contain the backed up data in cleartext. - - - - -# Colophon - -This manual is edited in Markdown and typeset using [Subplot][]. - ---- -title: "Obnam2—a backup system" -author: Lars Wirzenius -documentclass: report -bindings: - - subplot/server.yaml - - subplot/client.yaml - - subplot/data.yaml - - lib/files.yaml - - lib/runcmd.yaml -template: python -functions: - - subplot/server.py - - subplot/client.py - - subplot/data.py - - lib/daemon.py - - lib/files.py - - lib/runcmd.py -classes: - - json -abstract: | - Obnam is a backup system, consisting of a not very smart server for - storing chunks of backup data, and a client that splits the user's - data into chunks. They communicate via HTTP. - - This document describes the architecture and acceptance criteria for - Obnam, as well as how the acceptance criteria are verified. -... -- cgit v1.2.1 From d0b1e2c845fb0b63e4611c2806c7d038c6ef775d Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 15 Sep 2021 08:48:47 +0300 Subject: fix: add 'impl' to bindings files, for new Subplot Sponsored-by: author --- subplot/client.yaml | 50 ++++++++++++++++++++++++--------- subplot/data.yaml | 80 +++++++++++++++++++++++++++++++++++++++-------------- subplot/server.yaml | 76 ++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 153 insertions(+), 53 deletions(-) diff --git a/subplot/client.yaml b/subplot/client.yaml index d660089..9817186 100644 --- a/subplot/client.yaml +++ b/subplot/client.yaml @@ -1,36 +1,60 @@ - given: "an installed obnam" - function: install_obnam - cleanup: uninstall_obnam + impl: + python: + function: install_obnam + cleanup: uninstall_obnam - given: "a client config based on {filename}" - function: configure_client_with_init + impl: + python: + function: configure_client_with_init - given: "a client config, without passphrase, based on {filename}" - function: configure_client_without_init + impl: + python: + function: configure_client_without_init - when: "I invoke obnam restore <{genid}> {todir}" - function: run_obnam_restore + impl: + python: + function: run_obnam_restore - when: "I invoke obnam get-chunk <{gen_id}>" - function: run_obnam_get_chunk + impl: + python: + function: run_obnam_get_chunk - then: "backup generation is {varname}" - function: capture_generation_id + impl: + python: + function: capture_generation_id - then: "generation list contains <{gen_id}>" - function: generation_list_contains + impl: + python: + function: generation_list_contains - then: "file {filename} was backed up because it was new" - function: file_was_new + impl: + python: + function: file_was_new - then: "file {filename} was backed up because it was changed" - function: file_was_changed + impl: + python: + function: file_was_changed - then: "file {filename} was not backed up because it was unchanged" - function: file_was_unchanged + impl: + python: + function: file_was_unchanged - then: "stdout matches file {filename}" - function: stdout_matches_file + impl: + python: + function: stdout_matches_file - then: "stdout contains home directory followed by {path}" - function: stdout_contains_home_dir_path + impl: + python: + function: stdout_contains_home_dir_path diff --git a/subplot/data.yaml b/subplot/data.yaml index 46be6bc..533237f 100644 --- a/subplot/data.yaml +++ b/subplot/data.yaml @@ -1,59 +1,99 @@ - given: a file {filename} containing "{data:text}" - function: create_file_with_given_data + impl: + python: + function: create_file_with_given_data - given: "a file {filename} containing some random data" - function: create_file_with_random_data + impl: + python: + function: create_file_with_random_data - given: "a Unix socket {filename}" - function: create_unix_socket + impl: + python: + function: create_unix_socket - given: "a named pipe {filename}" - function: create_fifo + impl: + python: + function: create_fifo - given: a cache directory tag in {dirpath} - function: create_cachedir_tag_in + impl: + python: + function: create_cachedir_tag_in - given: "a file in {dirname} with a non-UTF8 filename" - function: create_nonutf8_filename + impl: + python: + function: create_nonutf8_filename - given: file {filename} has mode {mode} - function: chmod_file + impl: + python: + function: chmod_file - given: symbolink link {linkname} that points at {target} - function: create_symlink + impl: + python: + function: create_symlink - given: a manifest of the directory {dirname} in {manifest} - function: create_manifest_of_live + impl: + python: + function: create_manifest_of_live - given: a manifest of the directory {dirname} restored in {restored} in {manifest} - function: create_manifest_of_restored + impl: + python: + function: create_manifest_of_restored - given: "JSON file {json_name} converted from YAML file {yaml_name}" - function: convert_yaml_to_json + impl: + python: + function: convert_yaml_to_json - then: "stdout, as JSON, exactly matches file {filename}" - function: match_stdout_to_json_file_exactly + impl: + python: + function: match_stdout_to_json_file_exactly - then: "stdout, as JSON, has all the values in file {filename}" - function: match_stdout_to_json_file_superset + impl: + python: + function: match_stdout_to_json_file_superset - then: "file {filename} is restored to {restored}" - function: file_is_restored + impl: + python: + function: file_is_restored - then: "file {filename} is not restored to {restored}" - function: file_is_not_restored + impl: + python: + function: file_is_not_restored - then: "manifests {expected} and {actual} match" - function: manifests_match + impl: + python: + function: manifests_match - then: "file {filename} is only readable by owner" - function: file_is_readable_by_owner + impl: + python: + function: file_is_readable_by_owner - then: "file {filename} does not contain \"{pattern:text}\"" - function: file_does_not_contain + impl: + python: + function: file_does_not_contain - then: "files {filename1} and {filename2} are different" - function: files_are_different + impl: + python: + function: files_are_different - then: "files {filename1} and {filename2} are identical" - function: files_are_identical + impl: + python: + function: files_are_identical diff --git a/subplot/server.yaml b/subplot/server.yaml index fad749a..faf8f49 100644 --- a/subplot/server.yaml +++ b/subplot/server.yaml @@ -1,58 +1,94 @@ - given: "a running chunk server" - function: start_chunk_server - cleanup: stop_chunk_server + impl: + python: + function: start_chunk_server + cleanup: stop_chunk_server - given: "a running chunk server with environment {env:text}" - function: start_chunk_server - cleanup: stop_chunk_server + impl: + python: + function: start_chunk_server + cleanup: stop_chunk_server - when: "the chunk server is stopped" - function: stop_chunk_server + impl: + python: + function: stop_chunk_server - when: "I POST (?P\\S+) to (?P\\S+), with (?P
\\S+): (?P.*)" regex: true - function: post_file + impl: + python: + function: post_file - when: "I GET /chunks/<{var}>" - function: get_chunk_via_var + impl: + python: + function: get_chunk_via_var - when: "I try to GET /chunks/{chunk_id}" - function: get_chunk_by_id + impl: + python: + function: get_chunk_by_id - when: "I GET /chunks?sha256={sha}" regex: false - function: find_chunks_with_sha + impl: + python: + function: find_chunks_with_sha - when: "I DELETE /chunks/<{var}>" - function: delete_chunk_via_var + impl: + python: + function: delete_chunk_via_var - when: "I try to DELETE /chunks/{chunk_id}" - function: delete_chunk_by_id + impl: + python: + function: delete_chunk_by_id - when: "chunk <{chunk_id}> on chunk server is replaced by an empty file" - function: make_chunk_file_be_empty + impl: + python: + function: make_chunk_file_be_empty - then: "HTTP status code is {status}" - function: status_code_is + impl: + python: + function: status_code_is - then: "{header} is {value}" - function: header_is + impl: + python: + function: header_is - then: "the JSON body has a field {field}, henceforth {var}" - function: remember_json_field + impl: + python: + function: remember_json_field - then: "the JSON body matches (?P.*)" regex: true - function: json_body_matches + impl: + python: + function: json_body_matches - then: "the body matches file {filename}" - function: body_matches_file + impl: + python: + function: body_matches_file - then: "server has {n:int} chunks" - function: server_has_n_chunks + impl: + python: + function: server_has_n_chunks - then: chunk server's stderr contains "{wanted:text}" - function: server_stderr_contains + impl: + python: + function: server_stderr_contains - then: chunk server's stderr doesn't contain "{wanted:text}" - function: server_stderr_doesnt_contain + impl: + python: + function: server_stderr_doesnt_contain -- cgit v1.2.1