Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10625 from dachary/wip-16969-jewel
jewel: src/script/subman fails with KeyError: 'nband' Reviewed-by: Kefu Chai <kchai@redhat.com>
- Loading branch information
Showing
5 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
if [ -n "$CEPH_BUILD_DIR" ] && [ -n "$CEPH_ROOT" ] && [ -n "$CEPH_BIN" ] && [ -n "$CEPH_LIB" ]; then | ||
echo "Enivronment Variables Already Set" | ||
elif [ -e CMakeCache.txt ]; then | ||
echo "Environment Variables Not All Set, Detected Build System CMake" | ||
echo "Setting Environment Variables" | ||
export CEPH_ROOT=`grep Ceph_SOURCE_DIR CMakeCache.txt | cut -d "=" -f 2` | ||
export CEPH_BUILD_DIR=`pwd` | ||
export CEPH_BIN=$CEPH_BUILD_DIR/bin | ||
export CEPH_LIB=$CEPH_BUILD_DIR/lib | ||
export PATH=$CEPH_BIN:$PATH | ||
export LD_LIBRARY_PATH=$CEPH_LIB | ||
elif [ -e .libs ]; then | ||
echo "Environment Variables Not All Set, Detected Build System Autotools" | ||
echo "Setting Environment Variables" | ||
export CEPH_ROOT=".." | ||
export CEPH_BUILD_DIR="." | ||
export CEPH_BIN="." | ||
export CEPH_LIB=".libs" | ||
export PATH=.:$PATH | ||
export LD_LIBRARY_PATH=".libs" | ||
else | ||
echo "Please execute this command out of the proper directory" | ||
exit 1 | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash -e | ||
|
||
source $(dirname $0)/detect-build-env-vars.sh | ||
|
||
TMP=$(mktemp --tmpdir -d) | ||
trap "rm -fr $TMP" EXIT | ||
|
||
export PATH=$TMP:$PATH | ||
|
||
cat > $TMP/ceph-disk <<EOF | ||
echo '[{"partition":[{"type":"data","path":"/dev/foo/bar"}]}]' | ||
EOF | ||
chmod +x $TMP/ceph-disk | ||
|
||
cat > $TMP/df <<EOF | ||
echo Used | ||
echo $((2 * 1024 * 1024 * 1024)) | ||
EOF | ||
chmod +x $TMP/df | ||
|
||
cat > $TMP/expected <<EOF | ||
{ | ||
"band.storage.usage": 2 | ||
} | ||
EOF | ||
export CEPH_FACTS_FILE=$TMP/facts | ||
$CEPH_ROOT/src/script/subman | ||
diff -u $CEPH_FACTS_FILE $TMP/expected |