Skip to content

Commit

Permalink
Test fake DSDB
Browse files Browse the repository at this point in the history
Change-Id: I6f7ba5a9da3c1341bfa56788ee48510853ce0b61
  • Loading branch information
jrha committed Jul 26, 2018
1 parent 9b9af10 commit 643da45
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ before_script:
script:
- cd $TRAVIS_BUILD_DIR && tests/runtests.py -c tests/unittest.conf.travis --assume_yes
after_script:
- tail -n 128 /var/tmp/travis/aqtest/quattor/logs/aqd.log
- cat /tmp/fake_dsdb.log
- cat /var/tmp/travis/aqtest/quattor/logs/aqd.log
- ls /var/tmp/travis/aqtest/scratch
- ls /var/tmp/travis/aqtest/scratch/dsdb_coverage
- tail -n 128 /var/tmp/travis/aqtest/scratch/dsdb_coverage/issued_dsdb_cmds
Expand Down
2 changes: 2 additions & 0 deletions tests/broker/brokertest.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,8 @@ def dsdb_expect(self, command, fail=False, errstr=""):
filename = DSDB_EXPECT_SUCCESS_FILE

expected_name = os.path.join(self.dsdb_coverage_dir, filename)
print expected_name

with open(expected_name, "a") as fp:
if isinstance(command, list):
fp.write(" ".join(str(cmd) for cmd in command))
Expand Down
5 changes: 5 additions & 0 deletions tests/fakebin/fake_dsdb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ DATADIR=$(dirname "$0")/dsdb.d

if [ -z "$AQTEST_SCRATCHDIR" ]; then
exit 0
echo "WHOOPS" >> /tmp/fake_dsdb.log
fi

echo "AQTEST_SCRATCHDIR=$AQTEST_SCRATCHDIR" >> /tmp/fake_dsdb.log

AQTEST_DSDB_COVERAGE_DIR="$AQTEST_SCRATCHDIR/dsdb_coverage"

echo "AQTEST_DSDB_COVERAGE_DIR=$AQTEST_DSDB_COVERAGE_DIR" >> /tmp/fake_dsdb.log

echo "$*" >> "${AQTEST_DSDB_COVERAGE_DIR}/issued_dsdb_cmds"

if grep -q "^$*\$" "${AQTEST_DSDB_COVERAGE_DIR}/expected_dsdb_cmds" 2>/dev/null; then
Expand Down

0 comments on commit 643da45

Please sign in to comment.