Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ipfs-snap/tests/smoke_test.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
31 lines (21 sloc)
734 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
ipfs=/snap/bin/ipfs | |
script_path="$(dirname "$0")" | |
# Check the version. | |
$ipfs version | grep "^ipfs version .*$" | |
# Init the repo. | |
$ipfs init | |
# Show the readme. | |
$ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme | grep -z "^Hello and Welcome to IPFS!.*$" | |
# Start the daemon. | |
$ipfs daemon & | |
# Check the peers. | |
sleep 30 | |
$ipfs swarm peers | grep -E "ip4|ip6" | |
# Get an object from the network. | |
$ipfs cat /ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ/cat.jpg > cat.jpg | |
diff cat.jpg "$script_path/data/expected_cat.jpg" | |
# Put an object in the network. | |
hash=`echo "I <3 IPFS snap-test-$(uuidgen)" | $ipfs add -q` | |
curl "http://localhost:8080/ipfs/$hash" | grep "^I <3 IPFS snap-test-.*$" |