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 7c83bb7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ 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/expected_dsdb_cmds
- tail -n 128 /var/tmp/travis/aqtest/scratch/dsdb_coverage/issued_dsdb_cmds
- tail -n 128 /var/tmp/travis/aqtest/scratch/dsdb_coverage/failed_dsdb_cmds
addons:
hosts:
- travis.dev
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
7 changes: 7 additions & 0 deletions tests/fakebin/fake_dsdb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

echo "HELLO" >> /tmp/fake_dsdb.log

DATADIR=$(dirname "$0")/dsdb.d

if [ -z "$AQTEST_SCRATCHDIR" ]; then
echo "WHOOPS" >> /tmp/fake_dsdb.log
exit 0
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 7c83bb7

Please sign in to comment.