Opened 4 years ago

Closed 4 years ago

#4224 closed defect (fixed)

Consider using pgrep in keactrl and servers tests

Reported by: marcin Owned by: marcin
Priority: low Milestone: Kea1.0
Component: tests Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

The following thread on the kea-dev mailing list: https://lists.isc.org/pipermail/kea-dev/2015-December/000576.html describes issues which arose during creating an OpenBSD package of Kea. One of the issues is that some of the tests may fail when using:

_GET_PIDS=$( ps axwwo pid,command | grep ${proc_name}  | grep -v grep | awk '{print $1}' )

to determine whether the servers have been successfully shut down, because it may return unrelated processes. For example "make" process which builds Kea from packages.

It was also pointed out in the email thread that using 'pgrep' did eliminate this issue.

Subtickets

Change History (6)

comment:1 Changed 4 years ago by hschempf

  • Milestone changed from Kea-proposed to Kea1.0
  • Priority changed from medium to low

comment:2 Changed 4 years ago by marcin

  • Owner set to marcin
  • Status changed from new to assigned

comment:3 Changed 4 years ago by marcin

  • Owner changed from marcin to UnAssigned
  • Status changed from assigned to reviewing

I followed Thomas'es suggestion to use process PID file to check if the process is running or not. Proposed ChangeLog entry is:

10XX.	[bug]		marcin
	PID files created by Kea processes are used in shell based
	tests to determine if the given process is running. This
	solves the problem whereby some unrelated processes could
	be reported as running Kea processes in those tests, causing
	the tests to fail.
	(Trac #4224, git cafe)

comment:4 Changed 4 years ago by fdupont

  • Owner changed from UnAssigned to fdupont

comment:5 Changed 4 years ago by fdupont

  • Owner changed from fdupont to marcin

src/lib/testutils/dhcp_test_lib.sh.in:

in # PID file path is by default var/kea, but can be overriden by the IMHO you mean /var/kea
following -> following
it is a detail but processes have a number (vs. a name)

Please address these comments, validate with Jenkins & co, and merge.

comment:6 Changed 4 years ago by marcin

  • Resolution set to fixed
  • Status changed from reviewing to closed

Addressed review comments and megred with commit 94edccc50cb374ec4db35f653b869c9f06d356ea.

Note: See TracTickets for help on using tickets.