Skip to content

Commit 8896ddb

Browse files
committed
Don't clobber any settings_local.py in the ietf directory while running tests -- create a temporary one in the test directory instead.
- Legacy-Id: 449
1 parent fe83e20 commit 8896ddb

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

test/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test/run-pyflakes ietf
1313
trap 'echo "$program($LINENO): Caught Interrupt"' INT
1414

1515
# run tests with our patched django
16-
PYTHONPATH=test/lib python ietf/manage.py test
16+
PYTHONPATH=test:test/lib python ietf/manage.py test
1717

1818
# reset keyboard interrupt trap
1919
trap INT

test/test-setup

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ cd $build
4949
settings_local=$(py_module_file "settings_local")
5050
[ "$settings_local" ] || die "No setting_local file available"
5151

52-
cat $settings_local test/settings_local_test.py > ietf/settings_local.py
52+
cat $settings_local test/settings_local_test.py > test/settings_local.py
5353

5454
# Acquire lock, to prevent running test and database update at the same time
5555

@@ -59,8 +59,8 @@ PIDFILE=$LOCKDIR/pid
5959
while true; do
6060
if mkdir $LOCKDIR; then
6161
echo "$$" > $PIDFILE
62-
chmod a+xr $LOCKDIR
63-
chmod a+r $PIDFILE
62+
chmod a+rwx $LOCKDIR
63+
chmod a+rw $PIDFILE
6464
break
6565
else
6666
pid=$(< $PIDFILE )

test/test-teardown

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ build=$PWD
1212

1313
. $progdir/shell-utils
1414

15+
# Project teardown
16+
# Remove the temporary settings_local.py we created for the tests
17+
18+
rm -v test/settings_local.py
19+
1520
# Database Cleanup
1621
# Make sure the test database has been removed
1722
if echo "show databases;" | python ietf/manage.py dbshell | grep test_ietf; then

0 commit comments

Comments
 (0)