Something went wrong. Try again.
Manage a distributed indexed dataset of files and metadata, using a Dolt database to track who has copies of what.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667#!/bin/bash
# This contains some simple end-to-end tests to verify that the docker container# built correctly.
set -e
cd "$(dirname "$0")"source ./assert.sh
temp_dir=$(mktemp -d)cd $temp_dir
dolt-annex init
dolt-annex create filestore remote '{ "uuid": "123e4567-e89b-12d3-a456-426614174000", "type": "annexfs", "root": "." }'
output=$(dolt-annex gallery-dl https://e621.net/posts/14)assert_contain "$output" "Downloading post 14...Done"
expected_file_key="MD5_HSe-3e47080200fbde2d7d2ccf419343ab0a--s96998.jpg"output=$(dolt-annex dataset read-table --dataset gallery-dl --table-name submissions)
assert_contain "$output" '"source": "e621.net"'assert_contain "$output" '"id": 14'assert_contain "$output" "\"submission_file_key\": \"$expected_file_key\""
dolt-annex dataset read-table \ --dataset gallery-dl \ --table-name submissions \ --columns submission_file_key \ | jq -r '.submission_file_key' | dolt-annex filestore export-file > downloaded_image.png
actual_hash=$(md5sum downloaded_image.png | awk '{print $1}')assert_eq "$actual_hash" "3e47080200fbde2d7d2ccf419343ab0a"
output=$(dolt-annex dataset diff \ --dataset gallery-dl \ --table submissions \ --from __local__ \ --to remote \ | cut -d , -f 2 \ | dolt-annex filestore whereis)assert_contain "$output" '"name": "__local__"'
# Test filestore make_alias commandsha1_file_key="SHA1_HSe-8e5544bfa47e6ac5b3c69f69f2f38f2503aa62f4--s96998.jpg"
dolt-annex dataset read-table \ --dataset gallery-dl \ --table-name submissions \ --columns submission_file_key \ | jq -r '.submission_file_key' | dolt-annex filestore make-alias --key-type SHA1_HSe
echo $temp_dirdolt-annex filestore export-file $sha1_file_key > downloaded_image.png
sha1_hash=$(sha1sum downloaded_image.png | awk '{print $1}')echo $sha1_hashassert_eq "$sha1_hash" "8e5544bfa47e6ac5b3c69f69f2f38f2503aa62f4"
log_success "All tests passed!"