1. 05 Jul, 2021 8 commits
    • Dridi Boukelmoune's avatar
      varnishtest: New ${string,<action>[,<args>...]} macro · 5c248efc
      Dridi Boukelmoune authored
      Its first action ${string,repeat,<uint>,<string>} helps simplify many
      unwieldy test cases that will hopefully be easier to edit from now on.
      5c248efc
    • Dridi Boukelmoune's avatar
      1824ba01
    • Dridi Boukelmoune's avatar
      varnishtest: Allow macros to be backed by functions · 12cd341e
      Dridi Boukelmoune authored
      Instead of having a mere value, these would be able to compute a macro
      expansion. We parse the contents inside the ${...} delimiters as a VAV,
      but there can't be (yet?) nested curly {braces}, even quoted.
      
      The first argument inside the delimiters is the macro name, and other
      VAV arguments are treated as arguments to the macro's function.
      
      For example ${foo,bar,baz} would call the a macro "foo"'s function with
      arguments "bar" and "baz". Simple macros don't take arguments and work
      as usual.
      12cd341e
    • Dridi Boukelmoune's avatar
      varnishtest: Replace macro_get() with macro_cat() · eb71eae7
      Dridi Boukelmoune authored
      The latter operates on a VSB, which is always what call sites are doing
      anyway. It also takes the responsibility of ignoring unknown macros, in
      preparation for more responsibilities that will also require the ability
      to fail a test case.
      eb71eae7
    • Dridi Boukelmoune's avatar
      vav: Tighten arguments parsing · a2ab44de
      Dridi Boukelmoune authored
      Commas unlike spaces are hard separators, so a trailing comma leads to a
      last empty parameter.
      
      A comma may appear after an argument's "trailing" spaces and should not
      result in an additional parameter. In <foo  , bar> we should expect two
      fields, not three.
      
      Comments are only treated as such at arguments boundaries: <foo #bar>
      parses one field <foo> and <foo#bar> parses one field <foo#bar>, taking
      the shell word splitting as the model, cementing what was the existing
      VAV behavior in the first place.
      
      Unlike the shell, we don't expect quotes to start in the middle of a
      token so <foo"bar> is invalid unless escaping was disabled.
      
      Fields that are quoted need a separator: <"foo""bar"> is therefore
      invalid unless escaping was disabled.
      a2ab44de
    • Dridi Boukelmoune's avatar
      vav: Apparently we can't trust sscanf(3) · 4f1fd412
      Dridi Boukelmoune authored
      At least not on my system, where "x%02x" doesn't strictly require 2
      hexadecimal digits.
      4f1fd412
    • Dridi Boukelmoune's avatar
      97e6818a
    • Dridi Boukelmoune's avatar
      git: Ignore vav_test · ec2c30ac
      Dridi Boukelmoune authored
      ec2c30ac
  2. 02 Jul, 2021 8 commits
    • Dridi Boukelmoune's avatar
      Revert "vav: Treat a trailing comma as a separator" · 17d773c3
      Dridi Boukelmoune authored
      This reverts commit d3df1f64.
      
      I didn't mean to push it, it predates VAV's test driver.
      17d773c3
    • Dridi Boukelmoune's avatar
      vav: Treat a trailing comma as a separator · d3df1f64
      Dridi Boukelmoune authored
      Let's consider the following VAV strings:
      
          "foo bar baz"
          "foo,bar,baz"
          " foo bar baz "
          " foo,bar,baz "
          "  foo  bar  baz  "
      
      They are all equivalent because consecutive spaces are considered to
      form a single separator. However, consecutive commas aren't:
      
          "foo,bar,baz"
          "foo,,bar,,baz"
      
      In the example above the first string has 3 arguments while the second
      has 5 of them. This behavior was however inconsistent with trailing
      commas:
      
          "foo,bar,baz"
          "foo,bar,baz,"
          "foo,bar,baz,,"
      
      When it comes to trailing commas the first two strings above would
      contain 3 arguments, and the last string would contain 4 arguments.
      
      With this change, they respectively contain 3, 4 and 5 arguments.
      d3df1f64
    • Dridi Boukelmoune's avatar
      vav: Defer missing quote check · c7fb55b2
      Dridi Boukelmoune authored
      Otherwise we can still overflow in the absence of a null terminator.
      c7fb55b2
    • Dridi Boukelmoune's avatar
      vav: Fold main loop condition · e2286dfb
      Dridi Boukelmoune authored
      e2286dfb
    • Dridi Boukelmoune's avatar
      vav: Missing bound check · 2fd5e922
      Dridi Boukelmoune authored
      2fd5e922
    • Dridi Boukelmoune's avatar
      vav: Bound check after moving forward · ffe89512
      Dridi Boukelmoune authored
      There's no longer the guarantee of a null character at the end of a VAV
      string.
      ffe89512
    • Dridi Boukelmoune's avatar
      vav: Add a test driver · 70b7d584
      Dridi Boukelmoune authored
      It started with one corner case, then I found more, then I found new
      potential corner cases introduced by my own attempts at squaring them.
      
      I decided to take a step back and start some VAV test coverage. With
      something not too complicated to edit, dealing with the corner cases
      should increase confidence with the introduction of new cases easy
      to review.
      70b7d584
    • Jordan Christiansen's avatar
      circleci: Re-enable Alpine latest · 7795c2b3
      Jordan Christiansen authored
      Alpine 3.14 includes a newer version of musl that uses the newer
      faccessat2 syscall, which is not yet allowlisted by the seccomp filter
      in older Docker versions. Docker 20.10.0+ allows this new syscall.
      
      In this patch, we configure Circle to set up a Docker 20.10+ environment
      where we can run Alpine 3.14 builds.
      7795c2b3
  3. 30 Jun, 2021 4 commits
  4. 29 Jun, 2021 2 commits
  5. 28 Jun, 2021 2 commits
  6. 27 Jun, 2021 4 commits
    • Dridi Boukelmoune's avatar
      vtc: Stabilize and reorganize b15 · 121356d9
      Dridi Boukelmoune authored
      While in itself this is not a slow test, on a loaded system the
      connection failures can degrade the run time dramatically, like 20
      times slower.
      
      To save some time here and there, some client sessions were folded
      together where it made sense. Also no two clients share the same name
      to make it easier to spot the offending one in a test log.
      
      More importantly, the holddown test at the end which concerns the very
      first VCL is now put at the beginning where it belongs, and also where
      tweaking backend_remote_error_holddown will actually have the desired
      effect.
      121356d9
    • Dridi Boukelmoune's avatar
      vtc: Stabilize s6 · 3dcb2a50
      Dridi Boukelmoune authored
      Despite 1s of delay we sometimes observe a zero Age header, which is
      consistent with being under the max-age of 2s and should not fail.
      3dcb2a50
    • Dridi Boukelmoune's avatar
      vtc: Stabilize d3 · 3cb7f80c
      Dridi Boukelmoune authored
      There's always the possibility to fail reusing s2's first connection
      after it was closed.
      3cb7f80c
    • Dridi Boukelmoune's avatar
      vtc: Stabilize c93 · 97afc52e
      Dridi Boukelmoune authored
      On a loaded system the delay may not be enough, a barrier should.
      97afc52e
  7. 24 Jun, 2021 2 commits
  8. 23 Jun, 2021 4 commits
    • Dridi Boukelmoune's avatar
      f1e86c86
    • Dridi Boukelmoune's avatar
      varnishtest: Teach logexpect to stop with the vtc · 1ccba721
      Dridi Boukelmoune authored
      With a non-deterministic `expect * * ...` the logexpect thread would
      never consider itself to be done if the vtc ends if one entry was not
      seen in the vsl.
      1ccba721
    • Dridi Boukelmoune's avatar
      varnishtest: Make barriers reactive on error · 3c67da44
      Dridi Boukelmoune authored
      A failing test may take up to the vtc timeout to effectively fail if a
      thread is waiting for a barrier to sync. Barriers now check every 100ms
      whether the vtc is done to bail out.
      
      The socket barriers were already polling for 1s, so now they poll for
      100ms and leave the loop early when needed.
      
      The condvar barriers now loop over a timedwait, but critical sections
      were too wide. There were vtc_fatal() calls under barrier locks that
      would defeat the timedwait loop.
      
      Thus critical sections were more carefully laid, allowing multiple
      barrier commands to run simultaneously. This also means that besides
      initialization, socket barriers no longer touch the lock.
      
      Consider the following diff:
      
          --- bin/varnishtest/tests/v00056.vtc
          +++ bin/varnishtest/tests/v00056.vtc
          @@ -72,7 +72,7 @@ client c2 {
           } -run
      
           logexpect l2 -v v1 -g raw -q Backend_health {
          -       expect 0 0 Backend_health "default Went healthy"
          +       expect 0 0 Backend_health "default Went wrong"
           } -start
      
           barrier b3 sync
      
      With this change l2 would fail early, typically in less than 2s, but the
      barriers stuck in a condwait would prevent further progress.
      3c67da44
    • Guillaume Quintard's avatar
      [cci] refactor · 7b422447
      Guillaume Quintard authored
      7b422447
  9. 22 Jun, 2021 3 commits
  10. 21 Jun, 2021 3 commits