profile: fix test profile tests

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
Łukasz Magiera 2018-03-30 20:38:52 +02:00
parent 5a632f7017
commit dd23bec97e
2 changed files with 18 additions and 6 deletions

View File

@ -162,14 +162,21 @@ fetching may be degraded.
}
func appendSingle(a []string, b []string) []string {
m := map[string]struct{}{}
out := make([]string, 0, len(a)+len(b))
m := map[string]bool{}
for _, f := range a {
m[f] = struct{}{}
if !m[f] {
out = append(out, f)
}
m[f] = true
}
for _, f := range b {
m[f] = struct{}{}
if !m[f] {
out = append(out, f)
}
m[f] = true
}
return mapKeys(m)
return out
}
func deleteEntries(arr []string, del []string) []string {

View File

@ -212,8 +212,13 @@ test_config_cmd() {
test_profile_apply_revert server local-discovery
# won't work as we already have this profile applied
# test_profile_apply_revert test
# tests above mess with values this profile changes, need to do that before testing test profile
test_expect_success "ensure test profile is applied fully" '
ipfs config profile apply test
'
# need to do this in reverse as the test profile is already applied in sharness
test_profile_apply_revert default-networking test
# won't work as it changes datastore definition, which makes ipfs not launch
# without converting first