github.com/keltia/go-ipfs@v0.3.8-0.20150909044612-210793031c63/test/sharness/t0010-basic-commands.sh (about)

     1  #!/bin/sh
     2  #
     3  # Copyright (c) 2014 Christian Couder
     4  # MIT Licensed; see the LICENSE file in this repository.
     5  #
     6  
     7  test_description="Test installation and some basic commands"
     8  
     9  . lib/test-lib.sh
    10  
    11  test_expect_success "current dir is writable" '
    12  	echo "It works!" >test.txt
    13  '
    14  
    15  test_expect_success "ipfs version succeeds" '
    16  	ipfs version >version.txt
    17  '
    18  
    19  test_expect_success "ipfs version output looks good" '
    20  	cat version.txt | egrep "^ipfs version [0-9]+\.[0-9]+\.[0-9]" >/dev/null ||
    21  	test_fsh cat version.txt
    22  '
    23  
    24  test_expect_success "ipfs help succeeds" '
    25  	ipfs help >help.txt
    26  '
    27  
    28  test_expect_success "ipfs help output looks good" '
    29  	cat help.txt | egrep -i "^Usage:" >/dev/null &&
    30  	cat help.txt | egrep "ipfs .* <command>" >/dev/null ||
    31  	test_fsh cat help.txt
    32  '
    33  
    34  test_done