Skip to content

Commit 091fec8

Browse files
committed
wip
Signed-off-by: roman khapov <[email protected]>
1 parent ac4a649 commit 091fec8

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

docker/functional/bin/ody-stop

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ def main():
9494
print('Odyssey pids to stop:', ', '.join(list(map(str, pids))))
9595

9696
for pid in pids:
97+
# check if process failed because of asan (will work only if pid was an argument)
98+
if not asan_log_is_valid(pid) or not tsan_log_is_valid(pid):
99+
exit(1)
100+
97101
if not terminate_gracefully(pid, timeout):
98102
print(f'Process {pid} didnt finish within {timeout} seconds')
99103
print(subprocess.check_output(['gdb', '-p', str(pid), '--batch', '-ex',
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash -x
1+
#!/bin/bash -eux
22

33
ldapadd -x -H ldap://192.168.233.16 -D "cn=admin,dc=example,dc=org" -wadmin -f /tests/ldap/usr1.ldif
44
# wait for ldap server to do smt
@@ -11,54 +11,56 @@ ldapadd -x -H ldap://192.168.233.16 -D "cn=admin,dc=example,dc=org" -wadmin -f /
1111
sleep 1
1212

1313
/usr/bin/odyssey /tests/ldap/odyssey.conf
14+
sleep 1
15+
odyssey_pid=$(pidof odyssey)
1416

1517
PGPASSWORD=lolol psql -h localhost -p 6432 -U user1 -c "select 1" ldap_db >/dev/null 2>&1 || {
1618
echo "error: failed to successfully auth with correct password"
17-
ody-stop
19+
ody-stop $odyssey_pid
1820
cat /var/log/odyssey.log
1921
exit 1
2022
}
2123

2224
PGPASSWORD=notlolol psql -h localhost -p 6432 -U user1 -c "select 1" ldap_db >/dev/null 2>&1 && {
2325
echo "error: successfully auth with incorrect password"
24-
ody-stop
26+
ody-stop $odyssey_pid
2527
cat /var/log/odyssey.log
2628
exit 1
2729
}
2830

2931
PGPASSWORD=default psql -h localhost -p 6432 -U user3 -c "select 1" ldap_db >/dev/null 2>&1 && {
3032
echo "error: failed to successfully auth with correct password as default user"
31-
ody-stop
33+
ody-stop $odyssey_pid
3234
cat /var/log/odyssey.log
3335
exit 1
3436
}
3537

3638
PGPASSWORD=notdefault psql -h localhost -p 6432 -U user3 -c "select 1" ldap_db >/dev/null 2>&1 && {
3739
echo "error: successfully auth with incorrect password as default user"
38-
ody-stop
40+
ody-stop $odyssey_pid
3941
cat /var/log/odyssey.log
4042
exit 1
4143
}
4244

4345
PGPASSWORD=default psql -h localhost -p 6432 -U user4 -c "select current_user" ldap_db1 2>/dev/null | grep ldap_readonly | wc -l | grep -q '1' || {
4446
echo "error: failed to successfully auth with correct password and correct db"
45-
ody-stop
47+
ody-stop $odyssey_pid
4648
cat /var/log/odyssey.log
4749
exit 1
4850
}
4951

5052
PGPASSWORD=default psql -h localhost -p 6432 -U user4 -c "select current_user" ldap_db2 2>/dev/null | grep ldap_rw | wc -l | grep -q '1' || {
5153
echo "error: failed to successfully auth with correct password and correct db"
52-
ody-stop
54+
ody-stop $odyssey_pid
5355
cat /var/log/odyssey.log
5456
exit 1
5557
}
5658

5759
PGPASSWORD=notdefault psql -h localhost -p 6432 -U user4 -c "select 1" ldap_db1 >/dev/null 2>&1 && {
5860
echo "error: successfully auth with incorrect password"
59-
ody-stop
61+
ody-stop $odyssey_pid
6062
cat /var/log/odyssey.log
6163
exit 1
6264
}
6365

64-
ody-stop
66+
ody-stop $odyssey_pid

0 commit comments

Comments
 (0)