1. 09 Jan, 2019 1 commit
    • Petr Špaček's avatar
      trust_anchors: XML and certificate tests for bootstrap · d23aaece
      Petr Špaček authored
      At the moment tests are quite dumb and test only basic HTTPS certificate
      validation and XML parsing/error detection.
      
      We need to refactor code first to allow more detailed testing.
      
      FIXME: webserv.lua is not terminated when tests are finished
      d23aaece
  2. 26 Nov, 2018 1 commit
  3. 17 Aug, 2018 2 commits
  4. 14 Aug, 2018 1 commit
  5. 03 Aug, 2018 1 commit
    • Vladimír Čunát's avatar
      lua cache bindings: error out if cache isn't open yet · b1a16801
      Vladimír Čunát authored
      The catch is that during configuration file processing,
      no cache is open (yet), as kresd can't know if the config
      does open it in some later part (with non-default path or size).
      Now we just throw an error.  Exceptions:
       - cache.open() and cache.backends(), of course :-)
       - cache.ns_tout() - not required, it's not really inside cache
       - cache.close() - it sounds reasonable to allow "closing a closed cache"
      
      This immediately caught a typo in cache metatable.
      b1a16801
  6. 13 Jun, 2018 2 commits
  7. 09 May, 2018 1 commit
  8. 23 Apr, 2018 7 commits
  9. 20 Apr, 2018 1 commit
  10. 23 Jan, 2018 3 commits
  11. 08 Jan, 2018 2 commits
    • Marek Vavruša's avatar
    • Marek Vavruša's avatar
      Implement worker coroutines for asynchronous background processing · 8fa95978
      Marek Vavruša authored
      This implements worker coroutines in Lua to perform non-blocking I/O and do many things concurrently.
      For example a file watcher can be now implemented as:
      
      ```
        local watcher = notify.opendir('/etc')
        watcher:add('hosts')
      
        -- Watch changes to /etc/hosts
        worker.coroutine(function ()
          for flags, name in watcher:changes() do
            for flag in notify.flags(flags) do
              print(name, notify[flag])
            end
          end
        end)
      ```
      
      In order to make this work, the runtime uses the cqueues library which
      can run coroutines concurrently, and return a file descriptor to poll on
      if it's blocked. The worker takes that file descriptor and calls
      `event.socket(pollfd, resume_callback)` so that libuv can wake up
      the worker when its ready again.
      
      The cqueues library is still optional, but if it's not present following stuff
      won't work:
      
      * worker.coroutine()
      * worker.sleep()
      8fa95978
  12. 04 Jan, 2018 5 commits
  13. 23 Dec, 2017 2 commits
    • Petr Špaček's avatar
      CI coverage: merge test coverage data from parallel runs · b2497b13
      Petr Špaček authored
      We run tests in paralell so have to make sure that coverage tools
      do not overwrite results from each run.
      
      This is hacky because lcov tool insists on having gcno and gcda files
      in the same place as original source, so we have to copy files
      to workaround this.
      b2497b13
    • Petr Špaček's avatar
      CI coverage: handle Lua code coverage properly · 5a75e722
      Petr Špaček authored
      Luacov statistics contained paths to installed files instead of source
      files that it was a mess. The stats are now rewritten using hacky
      mapping (created from install commands produced by make).
      
      Also, branch and function coverage for Lua was always zero so now it is
      turned off not to confuse users.
      
      kresd config for respdiff now enables luacov as well.
      5a75e722
  14. 21 Dec, 2017 5 commits
  15. 28 Nov, 2017 1 commit
    • Marek Vavruša's avatar
      tests/config: added a TAP-based test environment for modules/configs · f41676d2
      Marek Vavruša authored
      I moved the test files to module directories because it allows
      vendoring of whole modules including tests etc.
      
      The test environment provides convenience functions and produces
      test output in TAP format. Ideally all tests should use a common
      format, so that CI can parse it provide better test output on PRs.
      It seems like Gitlab CI doesn't support anything yet, but there
      are two sort-of standards supported in CI tools - TAP and JUnit.
      I chose TAP because it's easier to read for humans, cmocka supports it,
      and it should be easier to adapt Deckard. There are also tools to
      convert TAP into JUnit XML file.
      
      Also added more tests for global functions and variables, and the
      test tool now also tracks coverage (if `luacov` is installed).
      f41676d2
  16. 24 Nov, 2017 5 commits