aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-compliance/cec-test-adapter.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2016-12-06 15:41:34 +0100
committerHans Verkuil <hans.verkuil@cisco.com>2016-12-06 15:41:34 +0100
commitcd5ddd95689c607c82584c3d127d3f4de4eba4d7 (patch)
treeb022f745a98ed3cb6ab1928f00b172e23887aeaa /utils/cec-compliance/cec-test-adapter.cpp
parent16994292e23a47ee35b9701fd393836cd40fece8 (diff)
cec-compliance: become temporarily a follower in the lost-msgs test
This test issues a lot of get-cec-version messages, and the remote device will reply with cec-version messages. If we are not a follower, and no other follower is running, then all these cec-version messages are feature aborted by the CEC core, which messes up this test (too much CEC traffic that can cause timeouts). So become a follower, just for this test, so that all these replies are just ignored. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils/cec-compliance/cec-test-adapter.cpp')
-rw-r--r--utils/cec-compliance/cec-test-adapter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils/cec-compliance/cec-test-adapter.cpp b/utils/cec-compliance/cec-test-adapter.cpp
index d3d3f772..8d0408cd 100644
--- a/utils/cec-compliance/cec-test-adapter.cpp
+++ b/utils/cec-compliance/cec-test-adapter.cpp
@@ -860,6 +860,7 @@ int testLostMsgs(struct node *node)
struct cec_event ev;
__u8 me = node->log_addr[0];
__u8 remote = CEC_LOG_ADDR_INVALID;
+ __u32 mode = CEC_MODE_INITIATOR | CEC_MODE_FOLLOWER;
for (unsigned i = 0; i < 15; i++) {
if (node->remote_la_mask & (1 << i)) {
@@ -870,6 +871,12 @@ int testLostMsgs(struct node *node)
fail_on_test(flush_pending_msgs(node));
fcntl(node->fd, F_SETFL, fcntl(node->fd, F_GETFL) | O_NONBLOCK);
+
+ // Become follower for this test, otherwise all the replies to
+ // the GET_CEC_VERSION message would have been 'Feature Abort'ed,
+ // unless some other follower was running. By becoming a follower
+ // all the CEC_VERSION replies are just ignored.
+ fail_on_test(doioctl(node, CEC_S_MODE, &mode));
cec_msg_init(&msg, me, remote);
cec_msg_get_cec_version(&msg, true);
@@ -920,5 +927,8 @@ int testLostMsgs(struct node *node)
/* Should be at least the size of the internal message queue */
fail_on_test(pending_msgs < 18 * 3);
+ mode = CEC_MODE_INITIATOR;
+ fail_on_test(doioctl(node, CEC_S_MODE, &mode));
+
return 0;
}

Privacy Policy