#!/bin/sh # # Copyright (c) 2014 Christian Couder # MIT Licensed; see the LICENSE file in this repository. # test_description="Test add and cat commands" . ./test-lib.sh test_launch_ipfs_mount test_expect_success "ipfs add succeeds" ' echo "Hello Worlds!" >mountdir/hello.txt && ipfs add mountdir/hello.txt >actual ' test_expect_success "ipfs add output looks good" ' HASH="QmVr26fY1tKyspEJBniVhqxQeEjhF78XerGiqWAwraVLQH" && echo "added $HASH $(pwd)/mountdir/hello.txt" >expected && test_cmp expected actual ' test_expect_success "ipfs cat succeeds" ' ipfs cat $HASH >actual ' test_expect_success "ipfs cat output looks good" ' echo "Hello Worlds!" >expected && test_cmp expected actual ' test_expect_success "cat ipfs/stuff succeeds" ' cat ipfs/$HASH >actual ' test_expect_success "cat ipfs/stuff looks good" ' test_cmp expected actual ' test_kill_ipfs_mount test_done