More test script examples
This commit is contained in:
parent
daf715929a
commit
058a1d64ab
2 changed files with 25 additions and 0 deletions
22
test/scripts/test_2.sh
Executable file
22
test/scripts/test_2.sh
Executable file
|
@ -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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
3
test/scripts/test_helpers.sh
Normal file
3
test/scripts/test_helpers.sh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function create_hello_world {
|
||||||
|
echo 'Hello, World!' > hello.txt
|
||||||
|
}
|
Loading…
Reference in a new issue