diff options
author | Daniel Salzman <daniel.salzman@nic.cz> | 2025-01-08 12:36:54 +0100 |
---|---|---|
committer | Daniel Salzman <daniel.salzman@nic.cz> | 2025-01-08 14:14:31 +0100 |
commit | 020c84e622e29ad7273d8d116e57e722079c8fa4 (patch) | |
tree | c188553bbb7197ac8598ab1f4a16bf227724e38d /tests-extra/tests/ctl/basic/test.py | |
parent | ctl: fix ctl stuck when abort sent to nonexisting conf txn... (diff) | |
download | knot-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.py | 9 |
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") |