github.com/keltia/go-ipfs@v0.3.8-0.20150909044612-210793031c63/test/sharness/t0061-daemon-opts.sh (about)

     1  #!/bin/sh
     2  #
     3  # Copyright (c) 2014 Juan Batiz-Benet
     4  # MIT Licensed; see the LICENSE file in this repository.
     5  #
     6  
     7  test_description="Test daemon command"
     8  
     9  . lib/test-lib.sh
    10  
    11  
    12  test_init_ipfs
    13  
    14  test_launch_ipfs_daemon --unrestricted-api --disable-transport-encryption
    15  
    16  gwyport=$PORT_GWAY
    17  apiport=$PORT_API
    18  
    19  test_expect_success 'api gateway should be unrestricted' '
    20    echo "hello mars :$gwyport :$apiport" >expected &&
    21    HASH=$(ipfs add -q expected) &&
    22    curl -sfo actual1 "http://127.0.0.1:$gwyport/ipfs/$HASH" &&
    23    curl -sfo actual2 "http://127.0.0.1:$apiport/ipfs/$HASH" &&
    24    test_cmp expected actual1 &&
    25    test_cmp expected actual2
    26  '
    27  
    28  # Odd. this fails here, but the inverse works on t0060-daemon.
    29  test_expect_success 'transport should be unencrypted' '
    30    go-sleep 0.5s | nc localhost "$PORT_SWARM" >swarmnc &&
    31    test_must_fail grep -q "AES-256,AES-128" swarmnc &&
    32    grep -q "/ipfs/identify" swarmnc ||
    33    test_fsh cat swarmnc
    34  '
    35  
    36  test_kill_ipfs_daemon
    37  
    38  test_done