t0236-cli-api-dns-resolve.sh 540 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/env bash
#
# Copyright (c) 2015 Jeromy Johnson
# MIT Licensed; see the LICENSE file in this repository.
#

test_description="test dns resolution of api endpoint by cli"

. lib/test-lib.sh

test_init_ipfs

test_expect_success "can make http request against dns resolved nc server" '
  nc -ld 5005 > nc_out &
  NCPID=$!
16
  go-sleep 1s && kill "$NCPID" &
Steven Allen's avatar
Steven Allen committed
17
  ipfs cat /ipfs/Qmabcdef --api /dns4/localhost/tcp/5005 || true
18 19 20 21 22 23 24
'

test_expect_success "request was received by local nc server" '
  grep "POST /api/v0/cat" nc_out
'

test_done