summaryrefslogtreecommitdiffstats
path: root/tests-extra/tests/ctl/basic/test.py
diff options
context:
space:
mode:
authorDaniel Salzman <daniel.salzman@nic.cz>2025-01-08 12:36:54 +0100
committerDaniel Salzman <daniel.salzman@nic.cz>2025-01-08 14:14:31 +0100
commit020c84e622e29ad7273d8d116e57e722079c8fa4 (patch)
treec188553bbb7197ac8598ab1f4a16bf227724e38d /tests-extra/tests/ctl/basic/test.py
parentctl: fix ctl stuck when abort sent to nonexisting conf txn... (diff)
downloadknot-020c84e622e29ad7273d8d116e57e722079c8fa4.tar.xz
knot-020c84e622e29ad7273d8d116e57e722079c8fa4.zip
ctl: improve error detection and send an error message to the client
Diffstat (limited to '')
-rw-r--r--tests-extra/tests/ctl/basic/test.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests-extra/tests/ctl/basic/test.py b/tests-extra/tests/ctl/basic/test.py
index a5defec8d..7f5b3b6e4 100644
--- a/tests-extra/tests/ctl/basic/test.py
+++ b/tests-extra/tests/ctl/basic/test.py
@@ -29,8 +29,13 @@ ctl.connect(os.path.join(knot.dir, "knot.sock"))
ctl.send_block(cmd="conf-abort")
resp = ctl.receive_block()
-ctl.send_block(cmd="conf-commit")
-resp = ctl.receive_block()
+try:
+ ctl.send_block(cmd="conf-commit")
+ resp = ctl.receive_block()
+except libknot.control.KnotCtlError as exc:
+ isset(exc.message == "no active transaction", "abort error code")
+else:
+ set_err("UNEXPECTED RETURN")
# Add new zone.
ctl.send_block(cmd="conf-begin")