Opened 6 months ago

Closed 5 months ago

#28938 closed defect (fixed)

Fix incorrect OpenBSD macro tests (fix testsuite failure)

Reported by: kjak Owned by:
Priority: Medium Milestone: Tor: 0.3.5.x-final
Component: Core Tor Version:
Severity: Normal Keywords: regression
Cc: Actual Points:
Parent ID: Points:
Reviewer: nickm Sponsor:

Description

The testsuite has been failing on OpenBSD, but an upcoming PR will fix this.

It was previously decided (ticket #20980) that the OpenBSD macro would be used to test for OpenBSD (rather than __OpenBSD__, etc.) because the former seems to be defined on OpenBSD forks when the latter may or may not be.

However, sys/param.h needs to be included for this macro to be defined. There were many files where OpenBSD was tested for, but when sys/param.h was not included.

An upcoming PR will contain a fix to include sys/param.h in the files where the OpenBSD macro is used (when it is not included already). It will also change a couple of instances of the __OpenBSD__ macro to OpenBSD.

See commit 27df23abb675ffeb198bf0c1cc85c4baed77a988 where the usage of __OpenBSD__ and OPENBSD macros were replaced with OpenBSD.

See also tickets #6982 and #20980 where the various macros were discussed. The latter ticket is where it was decided to use the OpenBSD macro.

I tested on this box:

$ uname -mrs
OpenBSD 6.4 amd64

Before:

=============================================
   tor 0.4.0.0-alpha-dev: ./test-suite.log
=============================================

# TOTAL: 20
# PASS:  15
# SKIP:  4
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

<snip>

options/validate__transproxy: [forking]
  FAIL src/test/test_options.c:1164: assert(tdata)
  [validate__transproxy FAILED]

<snip>

...and after:

=============================================
   tor 0.4.0.0-alpha-dev: ./test-suite.log
=============================================

# TOTAL: 20
# PASS:  16
# SKIP:  4
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0

Child Tickets

Change History (5)

comment:1 Changed 6 months ago by kjak

Status: newneeds_review

comment:2 Changed 6 months ago by kjak

I have tested using the branch release-0.3.4 and the test suite ran fine, so the test suite failure does not seem to be present in 0.3.4.

=======================================
   tor 0.3.4.9-dev: ./test-suite.log
=======================================

# TOTAL: 19
# PASS:  14
# SKIP:  5
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0

I also tested using the tag tor-0.3.5.4-alpha and the same test suite failure that the PR fixes appears there as well, so this is not a brand-new failure in 0.3.5.

=========================================
   tor 0.3.5.4-alpha: ./test-suite.log
=========================================

# TOTAL: 20
# PASS:  13
# SKIP:  5
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0

<snip>

options/validate__transproxy: [forking]
  FAIL src/test/test_options.c:1163: assert(tdata)
  [validate__transproxy FAILED]

<snip>

I have not done further builds to test, but from what I see I think this failure may have occurred since commit 6c440da9 which removed system headers (including sys/param.h) from or.h. On the 0.3.4 branch sys/param.h is still included in or.h.

comment:3 Changed 6 months ago by nickm

Keywords: regression added
Milestone: Tor: 0.3.5.x-final

comment:4 Changed 5 months ago by kjak

I have added a changes file to this PR.

But let me know if I should close this PR (which is for master) and open up a new one for maint-0.3.5 instead (similar to what I did for #28995), or if it's OK to leave it this time. (Recall from above that this failure occurs on 0.3.5 but not on 0.3.4.)

comment:5 Changed 5 months ago by nickm

Resolution: fixed
Reviewer: nickm
Status: needs_reviewclosed

No need for that -- I can cherry-pick the commits. Thanks! I have merged this to 0.3.5 and forward.

Note: See TracTickets for help on using tickets.