Opened 5 weeks ago

Closed 5 weeks ago

#23566 closed defect (fixed)

options/validate__transproxy fails on FreeBSD (thanks to the new scheduler)

Reported by: pastly Owned by: pastly
Priority: Medium Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-sched, regression
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Introduced in b2c56eacdd61429f17b9e14db665592ac4453c50 according to git bisect.

    sched: Remove vanilla sched options that will be going away

    - massive change to src/tgest/test_options.c since the sched options
      were added all over the place in it
    - removing the sched options caused some tests to pass/fail in new ways
      so I assumed current behavior is correct and made them pass again
       - ex: "ConnLimit must be greater" lines
       - ex: "Authoritative directory servers must" line
    - remove test_options_validate__scheduler in prep for new sched tests

And guess why it fails.

options/validate__transproxy: [forking]
  FAIL src/test/test_options.c:1129: Expected NULL but got 'ConnLimit must be greater than 0, but was set to 0'
  [validate__transproxy FAILED]

Child Tickets

Change History (7)

comment:1 Changed 5 weeks ago by nickm

Keywords: regression added

comment:2 Changed 5 weeks ago by pastly

Keywords: regression removed

In the spirit of

  • removing the sched options caused some tests to pass/fail in new ways so I assumed current behavior is correct and made them pass again

I present the following. I strongly suspect that the other blocks (OpenBSD and __NetBSD__) need the same fix but I have no way of testing.

diff --git a/src/test/test_options.c b/src/test/test_options.c
index 94a5a034d..72bfb673c 100644
--- a/src/test/test_options.c
+++ b/src/test/test_options.c
@@ -1132,9 +1132,8 @@ test_options_validate__transproxy(void *ignored)
                                 "TransPort 127.0.0.1:123\n");
   ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
   tt_int_op(ret, OP_EQ, -1);
-  if (msg) {
-    TT_DIE(("Expected NULL but got '%s'", msg));
-  }
+  tt_str_op(msg, OP_EQ, "ConnLimit must be greater than 0, but was set to 0");
+  tor_free(msg);
 #elif defined(OpenBSD)
   tdata = get_options_test_data("TransProxyType pf-divert\n"
                                 "TransPort 127.0.0.1:123\n");

comment:3 Changed 5 weeks ago by pastly

Keywords: regression added

comment:4 Changed 5 weeks ago by nickm

sounds okay, please turn this into a commit and put it in needs_review?

comment:5 Changed 5 weeks ago by pastly

Owner: set to pastly
Status: newassigned

When I make this into a branch, I'll be assuming the other BSDs need the same fix.

comment:6 Changed 5 weeks ago by pastly

Status: assignedneeds_review

bug23566_032_01

comment:7 Changed 5 weeks ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Sure, let's give it a try. Merged.

Note: See TracTickets for help on using tickets.