#!/usr/bin/env python3

import obuspa_cmd as ob

# Enable protocol logging so the agent logs the USP response (including err_code)
# to /tmp/output.log. The run script suppresses logging (verbose 0) globally,
# but this test depends on reading the agent log for err_code verification.
ob.cli("verbose", "4")

out = ob.test_controller("./test/python/invalid_operator.txt")

ob.cli("verbose", "0")

if 'err_code: 7008' in out:
    print("PASS: B#2741 Error on invalid operator")
else:
    print("FAIL: B#2741 Error on invalid operator")
    exit(1)
