Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
8a32251e
Commit
8a32251e
authored
Apr 14, 2020
by
Peter Rabbitson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not mangle diagnostics when sorted comparison needed
parent
b9fd894a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
test/sharness/t0054-dag-car-import-export.sh
test/sharness/t0054-dag-car-import-export.sh
+18
-11
No files found.
test/sharness/t0054-dag-car-import-export.sh
View file @
8a32251e
...
@@ -11,6 +11,13 @@ set -o pipefail
...
@@ -11,6 +11,13 @@ set -o pipefail
tar
-C
../t0054-dag-car-import-export-data/
--strip-components
=
1
-Jxf
../t0054-dag-car-import-export-data/test_dataset_car_v0.tar.xz
tar
-C
../t0054-dag-car-import-export-data/
--strip-components
=
1
-Jxf
../t0054-dag-car-import-export-data/test_dataset_car_v0.tar.xz
tab
=
$'
\t
'
tab
=
$'
\t
'
test_cmp_sorted
()
{
# use test_cmp to dump out the unsorted file contents as a diff
[[
"
$(
sort
"
$1
"
|
sha256sum
)
"
==
"
$(
sort
"
$2
"
|
sha256sum
)
"
]]
\
||
test_cmp
"
$1
"
"
$2
"
}
export
-f
test_cmp_sorted
reset_blockstore
()
{
reset_blockstore
()
{
node
=
$1
node
=
$1
...
@@ -65,11 +72,11 @@ EOE
...
@@ -65,11 +72,11 @@ EOE
../t0054-dag-car-import-export-data/combined_naked_roots_genesis_and_128.car \
../t0054-dag-car-import-export-data/combined_naked_roots_genesis_and_128.car \
../t0054-dag-car-import-export-data/lotus_testnet_export_128_shuffled_nulroot.car \
../t0054-dag-car-import-export-data/lotus_testnet_export_128_shuffled_nulroot.car \
../t0054-dag-car-import-export-data/lotus_devnet_genesis_shuffled_nulroot.car \
../t0054-dag-car-import-export-data/lotus_devnet_genesis_shuffled_nulroot.car \
| sort
> basic_import_actual
> basic_import_actual
'
'
test_expect_success
"basic import output as expected"
'
test_expect_success
"basic import output as expected"
'
test_cmp basic_import_expected basic_import_actual
test_cmp
_sorted
basic_import_expected basic_import_actual
'
'
test_expect_success
"basic fetch+export 1"
'
test_expect_success
"basic fetch+export 1"
'
...
@@ -92,11 +99,11 @@ EOE
...
@@ -92,11 +99,11 @@ EOE
test_expect_success
"import/pin naked roots only, relying on local blockstore having all the data"
'
test_expect_success
"import/pin naked roots only, relying on local blockstore having all the data"
'
ipfsi 1 dag import --enc=json ../t0054-dag-car-import-export-data/combined_naked_roots_genesis_and_128.car \
ipfsi 1 dag import --enc=json ../t0054-dag-car-import-export-data/combined_naked_roots_genesis_and_128.car \
| sort
> naked_import_result_json_actual
> naked_import_result_json_actual
'
'
test_expect_success
"naked import output as expected"
'
test_expect_success
"naked import output as expected"
'
test_cmp
naked_root_import_json_expected naked_import_result_json_actual
test_cmp
_sorted
naked_root_import_json_expected naked_import_result_json_actual
'
'
reset_blockstore 0
reset_blockstore 0
...
@@ -114,7 +121,7 @@ EOE
...
@@ -114,7 +121,7 @@ EOE
pipe_testnet \
pipe_testnet \
pipe_devnet \
pipe_devnet \
../t0054-dag-car-import-export-data/combined_naked_roots_genesis_and_128.car \
../t0054-dag-car-import-export-data/combined_naked_roots_genesis_and_128.car \
| sort
> basic_fifo_import_actual
> basic_fifo_import_actual
result=$?
result=$?
wait
wait
...
@@ -127,7 +134,7 @@ EOE
...
@@ -127,7 +134,7 @@ EOE
'
'
test_expect_success
"fifo-import output as expected"
'
test_expect_success
"fifo-import output as expected"
'
test_cmp basic_import_expected basic_fifo_import_actual
test_cmp
_sorted
basic_import_expected basic_fifo_import_actual
'
'
}
}
...
@@ -158,7 +165,7 @@ test_expect_success "basic offline export of nonexistent cid" '
...
@@ -158,7 +165,7 @@ test_expect_success "basic offline export of nonexistent cid" '
! ipfs dag export QmYwAPJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 2> offline_fetch_error_actual >/dev/null
! ipfs dag export QmYwAPJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 2> offline_fetch_error_actual >/dev/null
'
'
test_expect_success
"correct error"
'
test_expect_success
"correct error"
'
test_cmp offline_fetch_error_expected offline_fetch_error_actual
test_cmp
_sorted
offline_fetch_error_expected offline_fetch_error_actual
'
'
...
@@ -168,10 +175,10 @@ cat >multiroot_import_json_expected <<EOE
...
@@ -168,10 +175,10 @@ cat >multiroot_import_json_expected <<EOE
{"Root":{"Cid":{"/":"bafy2bzacede2hsme6hparlbr4g2x6pylj43olp4uihwjq3plqdjyrdhrv7cp4"},"PinErrorMsg":""}}
{"Root":{"Cid":{"/":"bafy2bzacede2hsme6hparlbr4g2x6pylj43olp4uihwjq3plqdjyrdhrv7cp4"},"PinErrorMsg":""}}
EOE
EOE
test_expect_success
"multiroot import works"
'
test_expect_success
"multiroot import works"
'
ipfs dag import --enc=json ../t0054-dag-car-import-export-data/lotus_testnet_export_256_multiroot.car
| sort
> multiroot_import_json_actual
ipfs dag import --enc=json ../t0054-dag-car-import-export-data/lotus_testnet_export_256_multiroot.car > multiroot_import_json_actual
'
'
test_expect_success
"multiroot import expected output"
'
test_expect_success
"multiroot import expected output"
'
test_cmp multiroot_import_json_expected multiroot_import_json_actual
test_cmp
_sorted
multiroot_import_json_expected multiroot_import_json_actual
'
'
...
@@ -188,10 +195,10 @@ test_expect_success "expected silence on --pin-roots=false" '
...
@@ -188,10 +195,10 @@ test_expect_success "expected silence on --pin-roots=false" '
test_expect_success
"naked root import works"
'
test_expect_success
"naked root import works"
'
ipfs dag import --enc=json ../t0054-dag-car-import-export-data/combined_naked_roots_genesis_and_128.car \
ipfs dag import --enc=json ../t0054-dag-car-import-export-data/combined_naked_roots_genesis_and_128.car \
| sort
> naked_root_import_json_actual
> naked_root_import_json_actual
'
'
test_expect_success
"naked root import expected output"
'
test_expect_success
"naked root import expected output"
'
test_cmp naked_root_import_json_expected naked_root_import_json_actual
test_cmp
_sorted
naked_root_import_json_expected naked_root_import_json_actual
'
'
test_done
test_done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment