Skip to content

Commit

Permalink
added gleaner s3 dir cnt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adplincinst committed May 29, 2024
1 parent c164043 commit 06d840b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test_geoconnex_dev_sitemap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@ jobs:
- run: $HOME/bin/mc mb myminio/iow
- run: make
- run: sh scripts/iow/start-gleaner.sh
- run: sh scripts/iow/assert-s3-dir-cnt.sh $HOME/bin/mc myminio/iow/orgs 5
- run: sh scripts/iow/assert-s3-dir-cnt.sh $HOME/bin/mc myminio/iow/prov/cdss0 30
- run: sh scripts/iow/assert-s3-dir-cnt.sh $HOME/bin/mc myminio/iow/prov/dams0 45
- run: sh scripts/iow/assert-s3-dir-cnt.sh $HOME/bin/mc myminio/iow/prov/nmwdist0 266
- run: sh scripts/iow/assert-s3-dir-cnt.sh $HOME/bin/mc myminio/iow/prov/refgages0 330
- run: sh scripts/iow/assert-s3-dir-cnt.sh $HOME/bin/mc myminio/iow/prov/refmainstems 66
- run: sh scripts/iow/assert-s3-dir-cnt.sh $HOME/bin/mc myminio/iow/summoned/cdss0 30
- run: sh scripts/iow/assert-s3-dir-cnt.sh $HOME/bin/mc myminio/iow/summoned/dams0 45
- run: sh scripts/iow/assert-s3-dir-cnt.sh $HOME/bin/mc myminio/iow/summoned/nmwdist0 265
- run: sh scripts/iow/assert-s3-dir-cnt.sh $HOME/bin/mc myminio/iow/summoned/refgages0 330
- run: sh scripts/iow/assert-s3-dir-cnt.sh $HOME/bin/mc myminio/iow/summoned/refmainstems 66

19 changes: 19 additions & 0 deletions scripts/iow/assert-s3-dir-cnt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

MC="$1"
DIR="$2"
DESIRED_COUNT="$3"

if [ "$#" -ne 3 ]
then
echo "Usage: $0 MC_CMD_PATH DIR DESIRED_COUNT" && exit 1
fi


ACTUAL_COUNT=`$MC ls $DIR| wc -l`

if [ "$DESIRED_COUNT" -ne "$ACTUAL_COUNT" ]
then
echo "$DIR: wanted $DESIRED_COUNT directory entries, found $ACTUAL_COUNT"
fi

0 comments on commit 06d840b

Please sign in to comment.