- if ret == 1 and fds_length == 1 and overflow == 0 and \
- fds[0]["data_union"]["fd"] == 0 and \
- fds[0]["events"]["EPOLLIN"] == 1:
- self.expect["epoll_wait_out_fd0"] = 1
-
-
-class Test2(TraceParser):
- def __init__(self, trace, pid):
- super().__init__(trace, pid)
- self.expect["select_timeout_in_fd0"] = 0
- self.expect["select_timeout_in_fd1023"] = 0
- self.expect["select_timeout_out"] = 0
- self.expect["poll_timeout_in"] = 0
- self.expect["poll_timeout_out"] = 0
- self.expect["epoll_ctl_timeout_in_add"] = 0
- self.expect["epoll_ctl_timeout_out_ok"] = 0
- self.expect["epoll_wait_timeout_in"] = 0
- self.expect["epoll_wait_timeout_out"] = 0
+ if ret == 1 and fds_length == 1:
+ fd_0 = event["fds"][0]
+ if overflow == 0 and fd_0["data_union"]["fd"] == 0 and \
+ fd_0["events"]["EPOLLIN"] == 1:
+ self.expect["epoll_wait_exit"]["epoll_wait_out_fd0"] = 1
+
+ # Save values of local variables to print in case of test failure
+ self.recorded_values["epoll_wait_exit"] = locals()
+
+ def epoll_pwait_entry(self, event):
+ epfd = event["epfd"]
+ maxevents = event["maxevents"]
+ timeout = event["timeout"]
+
+ if epfd == self.epoll_pwait_fd and maxevents == 1 and timeout == -1:
+ self.expect["epoll_pwait_entry"]["epoll_pwait_in_ok"] = 1
+
+ # Save values of local variables to print in case of test failure
+ self.recorded_values["epoll_pwait_entry"] = locals()
+
+ def epoll_pwait_exit(self, event):
+ ret = event["ret"]
+ fds_length = event["fds_length"]
+ overflow = event["overflow"]
+
+ # check that FD 0 returned with EPOLLIN and the right data.fd
+ if ret == 1 and fds_length == 1:
+ fd_0 = event["fds"][0]
+ if overflow == 0 and fd_0["data_union"]["fd"] == 0 and \
+ fd_0["events"]["EPOLLIN"] == 1:
+ self.expect["epoll_pwait_exit"]["epoll_pwait_out_fd0"] = 1
+
+ # Save values of local variables to print in case of test failure
+ self.recorded_values["epoll_pwait_exit"] = locals()
+
+class WorkingCasesTimeout(TraceParser):
+ def __init__(self, trace, validation_args):
+ super().__init__(trace, validation_args['pid'])
+ self.expect["select_entry"]["select_timeout_in_fd0"] = 0
+ self.expect["select_entry"]["select_timeout_in_fd1023"] = 0
+ self.expect["select_exit"]["select_timeout_out"] = 0
+ self.expect["poll_entry"]["poll_timeout_in"] = 0
+ self.expect["poll_exit"]["poll_timeout_out"] = 0
+ self.expect["epoll_ctl_entry"]["epoll_ctl_timeout_in_add"] = 0
+ self.expect["epoll_ctl_exit"]["epoll_ctl_timeout_out_ok"] = 0
+ self.expect["epoll_wait_entry"]["epoll_wait_timeout_in"] = 0
+ self.expect["epoll_wait_exit"]["epoll_wait_timeout_out"] = 0