1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 19:44:01 +08:00

15 Commits

Author SHA1 Message Date
1054826ac4 switch base64 decoder based on OS
Less magical.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-01-28 14:13:16 -08:00
d0998a926d make base64 decoding cross-platform
support both the -D and the -d flag.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-01-27 13:45:36 -08:00
de02525594 strip ANSI sequences from docker build output
sharness was failing because an ANSI reset sequence was getting inserted at the
beginning of the line.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-14 08:37:27 -08:00
2489dfe8a9 ipfs-test-lib: fix test_fsh arg quoting
test_fsh() should quote its arguments before passing them
to `eval` otherwise there are problems when the arguments
contain spaces.

For example when running the following program:

```
#!/bin/sh

. ./ipfs-test-lib.sh

die () {
    printf >&2 "%s\n" "$@"
    exit 1
}

DIR1="test dir 1"
DIR2="test dir 2"

mkdir "$DIR1" "$DIR2" || die "Could not mkdir '$DIR1' '$DIR2'"

echo "in dir 1" >"$DIR1/file1" || die "Could not write into '$DIR1/file1'"
echo "in dir 2" >"$DIR2/file2" || die "Could not write into '$DIR2/file2'"

if test_cmp "$DIR1/file1" "$DIR2/file2"
then
    echo "test_cmp succeeded!"
else
    echo "test_cmp failed!"
fi

rm -rf "$DIR1" "$DIR2" || die "Could not rm -rf '$DIR1' '$DIR2'"

```

we get:

```
> diff -u test dir 1/file1 test dir 2/file2
diff: extra operand '1/file1'
diff: Try 'diff --help' for more information.

test_cmp failed!
```

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-08-15 12:10:15 +02:00
7d80512a4c test-lib: add test_path_cmp()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-02-12 17:20:23 -08:00
81c8cffee9 Rework the Dockerfile
- Have two Dockerfiles doing essentially the same,
  but optimized for build time (for tests)
  and image size (for Docker Hub)
- Fetch gx dependencies
- Expose port 4002 for utp
- Specify go version, currently 1.5.3-r0
- Create ephemeral fs-repo if none is mounted
- Have t0300-docker-image actually test IPFS, not just an echo
- Make everything a bit less hardcoded
- Remove dead shacheck

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-02-04 10:46:26 -08:00
531f0579a4 sharness: Don't assume we know all things that can create garbage
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

sharness: Don't assume we know all things that can create garbage

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:21:13 -08:00
29ec4c06e4 test/ipfs-test-lib: add docker support
We have to do something special for CircleCI in docker_exec()
because "docker exec" doesn't work on CircleCi:

https://circleci.com/docs/docker#docker-exec

We indeed get "Unsupported: Exec is not supported by the lxc
driver" with CircleCi, when using "docker exec".

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-01-10 20:19:23 +01:00
088aa1a623 ipfs-test-lib: clarify and simplify shellquote()
Let's first add a comment to explain why the wrapper printf()
is needed.

Then let's replace the last instructions by quotes inside the
wrapper printf() first argument, and let's also put there the
eventual space so that we can remove the printf on the above
line.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-03 23:35:44 +02:00
4cab9fe37e ipfs-test-lib: fix shellquote() on Mac OS
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-10-03 16:06:40 +02:00
1bd182055b ipfs-test-lib: add shellquote()
This function can be usefull in many places.

See for example:

https://github.com/ipfs/go-ipfs/pull/1742

Git has `git rev-parse --sq-quote` that does the same thing.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-09-27 09:11:25 +02:00
408a818b4a ipfs-test-lib: use test_seq from sharness
As Sharness now includes test_seq we can remove
our implementation.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-06-14 11:21:32 +02:00
3c2e0ba586 ipfs-test-lib: implement test_seq()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-06-03 23:51:50 +02:00
1f1507106a test: implement test_sort_cmp()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-04 07:37:37 +02:00
65cbbdff84 Add ipfs-test-lib.sh and source it in sharness test-lib.sh
The new ipfs-test-lib.sh file contains generic test
functions.
We also start replacing fsh with a shell function named
test_fsh() in ipfs-test-lib.sh.
And we move our custom test_cmp in ipfs-test-lib.sh.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-02-04 21:50:07 +01:00