Skip to content

Commit

Permalink
t/t1000-kvs.t: cover "flux ls"
Browse files Browse the repository at this point in the history
  • Loading branch information
garlick committed Aug 29, 2017
1 parent 116c9f4 commit 6f7389d
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions t/t1000-kvs.t
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,56 @@ EOF
test_cmp expected output
'

#
# ls tests
#
test_expect_success 'kvs: ls -1F DIR works' '
flux kvs unlink -Rf $DIR &&
flux kvs put $DIR.a=69 &&
flux kvs mkdir $DIR.b &&
flux kvs link b $DIR.c &&
flux kvs ls -1F $DIR | sort >output &&
cat >expected <<-EOF &&
a
b.
c@
EOF
test_cmp expected output
'
test_expect_success 'kvs: ls -1Fd DIR.a DIR.b DIR.c works' '
flux kvs unlink -Rf $DIR &&
flux kvs put $DIR.a=69 &&
flux kvs mkdir $DIR.b &&
flux kvs link b $DIR.c &&
flux kvs ls -1Fd $DIR.a $DIR.b $DIR.c | sort >output &&
cat >expected <<-EOF &&
$DIR.a
$DIR.b.
$DIR.c@
EOF
test_cmp expected output
'
test_expect_success 'kvs: ls -1RCF shows directory titles' '
flux kvs unlink -Rf $DIR &&
flux kvs put $DIR.a=69 &&
flux kvs put $DIR.b.d=42 &&
flux kvs link b $DIR.c &&
flux kvs ls -1RCF $DIR | grep : | wc -l >output &&
cat >expected <<-EOF &&
2
EOF
test_cmp expected output
'
test_expect_success 'kvs: ls -C works' '
flux kvs unlink -Rf $DIR &&
${FLUX_BUILD_DIR}/t/kvs/dtree -p$DIR -h2 -w50 &&
flux kvs ls -C -w80 $DIR | wc -wl >output &&
cat >expected <<-EOF &&
5 50
EOF
test_cmp expected output
'

#
# get corner case tests
#
Expand Down

0 comments on commit 6f7389d

Please sign in to comment.