From 47e7583464d8fe612aeafd13d452593ad9b1ac23 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sat, 25 Oct 2014 22:13:27 +0200 Subject: [PATCH 1/3] Add test/.gitignore to ignore test-results/ License: MIT Signed-off-by: Christian Couder --- test/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/.gitignore diff --git a/test/.gitignore b/test/.gitignore new file mode 100644 index 00000000000..51511d1f8f3 --- /dev/null +++ b/test/.gitignore @@ -0,0 +1 @@ +test-results/ From 07bd18b53d893d2ddd8088e558905244b85e5662 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sun, 26 Oct 2014 09:47:05 +0100 Subject: [PATCH 2/3] Display which Makefile target is launched License: MIT Signed-off-by: Christian Couder --- test/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/Makefile b/test/Makefile index b4a1feb857d..7e6381794a9 100644 --- a/test/Makefile +++ b/test/Makefile @@ -9,12 +9,15 @@ T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)) all: clean $(T) aggregate clean: + @echo "*** $@ ***" -rm -r test-results $(T): - @echo "*** $@ ***"; ./$@ + @echo "*** $@ ***" + ./$@ aggregate: + @echo "*** $@ ***" ./test-aggregate-results.sh .PHONY: all clean $(T) aggregate From 8357c7b13df39ddd63f65499d62b938b9e0a23fc Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sun, 26 Oct 2014 09:43:41 +0100 Subject: [PATCH 3/3] Add test script for ipfs init License: MIT Signed-off-by: Christian Couder --- test/t0020-init.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 test/t0020-init.sh diff --git a/test/t0020-init.sh b/test/t0020-init.sh new file mode 100755 index 00000000000..01601420cd8 --- /dev/null +++ b/test/t0020-init.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# +# Copyright (c) 2014 Christian Couder +# MIT Licensed; see the LICENSE file in this repository. +# + +test_description="Test init command" + +. ./test-lib.sh + +test_expect_success "ipfs init succeeds" ' + export IPFS_DIR="$(pwd)/.go-ipfs" && + ipfs init +' + +test_expect_success ".go-ipfs/ has been created" ' + test -d ".go-ipfs" && + test -f ".go-ipfs/config" && + test -d ".go-ipfs/datastore" +' + +test_expect_success "ipfs config succeeds" ' + echo leveldb >expected && + ipfs config Datastore.Type >actual && + test_cmp expected actual +' + +test_done +