From 058a1d64ab2355e3e6211b2eeec991e9ac40b08a Mon Sep 17 00:00:00 2001 From: jmjatlanta Date: Wed, 27 Sep 2017 06:16:18 -0500 Subject: [PATCH] More test script examples --- test/scripts/test_2.sh | 22 ++++++++++++++++++++++ test/scripts/test_helpers.sh | 3 +++ 2 files changed, 25 insertions(+) create mode 100755 test/scripts/test_2.sh create mode 100644 test/scripts/test_helpers.sh diff --git a/test/scripts/test_2.sh b/test/scripts/test_2.sh new file mode 100755 index 0000000..67ba9ec --- /dev/null +++ b/test/scripts/test_2.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +source ./test_helpers.sh + +IPFS="../../main/ipfs --config /tmp/ipfs_1" + +function pre { + eval "$IPFS" init; +} + +function post { + rm -Rf /tmp/ipfs_1; + rm hello.txt; +} + +function body { + create_hello_world; + eval "$IPFS" add hello.txt + eval "$IPFS" object cat Qm123456 +} + + diff --git a/test/scripts/test_helpers.sh b/test/scripts/test_helpers.sh new file mode 100644 index 0000000..51ed721 --- /dev/null +++ b/test/scripts/test_helpers.sh @@ -0,0 +1,3 @@ +function create_hello_world { + echo 'Hello, World!' > hello.txt +}