Skip to content
Snippets Groups Projects
  1. Feb 27, 2019
    • George Joseph's avatar
      CI: Update jenkinsfiles with new Gerrit URLs · e0fc6632
      George Joseph authored
      The recent upgrade of Gerrit to 2.16 elimiated referencing a
      repository in a way the jenkinsfiles were relying on so
      the URL references were changed to a more consistent and supported
      format.
      
      Change-Id: I2e8e3f213b9a96bb1b27665eca4a9a24bc49820e
      (cherry picked from commit 5ce08457)
      e0fc6632
  2. Feb 20, 2019
    • George Joseph's avatar
      taskprocessor: Enable subsystems and overload by subsystem · c2adeb9d
      George Joseph authored
      To prevent one subsystem's taskprocessors from causing others
      to stall, new capabilities have been added to taskprocessors.
      
      * Any taskprocessor name that has a '/' will have the part
        before the '/' saved as its "subsystem".
        Examples:
        "sorcery/acl-0000006a" and "sorcery/aor-00000019"
        will be grouped to subsystem "sorcery".
        "pjsip/distributor-00000025" and "pjsip/distributor-00000026"
        will bn grouped to subsystem "pjsip".
        Taskprocessors with no '/' have an empty subsystem.
      
      * When a taskprocessor enters high-water alert status and it
        has a non-empty subsystem, the subsystem alert count will
        be incremented.
      
      * When a taskprocessor leaves high-water alert status and it
        has a non-empty subsystem, the subsystem alert count will be
        decremented.
      
      * A new api ast_taskprocessor_get_subsystem_alert() has been
        added that returns the number of taskprocessors in alert for
        the subsystem.
      
      * A new CLI command "core show taskprocessor alerted subsystems"
        has been added.
      
      * A new unit test was addded.
      
      REMINDER: The taskprocessor code itself doesn't take any action
      based on high-water alerts or overloading.  It's up to taskprocessor
      users to check and take action themselves.  Currently only the pjsip
      distributor does this.
      
      * A new pjsip/global option "taskprocessor_overload_trigger"
        has been added that allows the user to select the trigger
        mechanism the distributor uses to pause accepting new requests.
        "none": Don't pause on any overload condition.
        "global": Pause on ANY taskprocessor overload (the default and
        current behavior)
        "pjsip_only": Pause only on pjsip taskprocessor overloads.
      
      * The core pjsip pool was renamed from "SIP" to "pjsip" so it can
        be properly grouped into the "pjsip" subsystem.
      
      * stasis taskprocessor names were changed to "stasis" as the
        subsystem.
      
      * Sorcery core taskprocessor names were changed to "sorcery" to
        match the object taskprocessors.
      
      Change-Id: I8c19068bb2fc26610a9f0b8624bdf577a04fcd56
      c2adeb9d
  3. Feb 19, 2019
    • Joshua Colp's avatar
      CI: Use tmpfs option to Docker instead of mount. · f4c9a351
      Joshua Colp authored
      Some tests require Asterisk to execute scripts which
      are stored in /tmp. When mount is used for tmpfs there
      is no ability to allow scripts to be executed from
      that location.
      
      This change switches to using tmpfs which can be told
      to allow executables to be run from /tmp.
      
      Change-Id: I0e598ca2b76af1f7f2d29f0da7b1731a214a291a
      f4c9a351
  4. Feb 08, 2019
    • Joshua Colp's avatar
      ci: Rerun unit tests when non-code changes occur. · c2ea9c90
      Joshua Colp authored
      This change makes it so that even if non-code changes
      occur (such as commit message changing) unit tests
      will still be run and result in a verification.
      
      ASTERISK-28251
      
      Change-Id: I6491fff7c93e5d5cd8e41054486968bf66c4f608
      c2ea9c90
  5. Dec 07, 2018
    • George Joseph's avatar
      stasis: Allow filtering by formatter · 3f3dd992
      George Joseph authored
      A subscriber can now indicate that it only wants messages
      that have formatters of a specific type.  For instance,
      manager can indicate that it only wants messages that have a
      "to_ami" formatter.  You can combine this with the existing
      filter for message type to get only messages with specific
      formatters or messages of specific types.
      
      ASTERISK-28186
      
      Change-Id: Ifdb7a222a73b6b56c6bb9e4ee93dc8a394a5494c
      3f3dd992
  6. Dec 05, 2018
    • George Joseph's avatar
      CI: Various updates to buildAsterisk.sh · 19c4e0f5
      George Joseph authored
      * Added ---no-configure, --no-menuselect, --no-make and --no-alembic
        options that prevent those actions from being performed.  Useful
        for testing and re-running portions of the build after fixing
        earlier failures.
      
      * Added "set -e" to abort the script on command failure.
        Not sure why this wasn't there in the first place.
      
      * Fixed a few echos that were redirecting to stderr when they shouldn't
        have been.
      
      * Catch more alembic failures by actually trying to generate the SQL.
      
      Change-Id: I9f395fa4e9254be7299e7c1014f1a13db78faffb
      19c4e0f5
  7. Dec 02, 2018
    • Chris-Savinovich's avatar
      test_websocket_client.c: Disable websocket_client_create_and_connect test. · 6c13b208
      Chris-Savinovich authored
      This test was occasionally failing, with:
      
        WARNING[5812]: http.c:1939 httpd_helper_thread: Failed to set
            TCP_NODELAY on HTTP connection: Bad file descriptor
        ERROR[5812]: iostream.c:91 ast_iostream_nonblock: Failed to get
            fcntl() flags for file descriptor: Bad file descriptor
        ERROR[5812]: iostream.c:569 ast_iostream_close: close() failed: Bad
            file descriptor
      
      Disabled for now by making the test explicit only.
      
      Change-Id: I778f6cbb6104c6b4e89737a2eaf1a9540888d351
      6c13b208
  8. Nov 26, 2018
    • George Joseph's avatar
      test_cel: Plug a few ref leaks · f4924d40
      George Joseph authored
      These are only a few of the leaks.  The large number of macros
      and return paths in this file would make a weeks worth of work
      to plug them all.
      
      Change-Id: Ie2369fa944023d44767871c5c30974cb077ffb56
      f4924d40
    • George Joseph's avatar
      bridges: Remove reliance on stasis caching · 3667c5e1
      George Joseph authored
      * The bridging core no longer uses the stasis cache for bridge
        snapshots.  The latest bridge snapshot is now stored on the
        ast_bridge structure itself.
      
      * The following APIs are no longer available since the stasis cache
        is no longer used:
          ast_bridge_topic_cached()
          ast_bridge_topic_all_cached()
      
      * A topic pool is now used for individual bridge topics.
      
      * The ast_bridge_cache() function was removed since there's no
        longer a separate container of snapshots.
      
      * A new function "ast_bridges()" was created to retrieve the
        container of all bridges.  Users formerly calling
        ast_bridge_cache() can use the new function to iterate over
        bridges and retrieve the latest snapshot directly from the
        bridge.
      
      * The ast_bridge_snapshot_get_latest() function was renamed to
        ast_bridge_get_snapshot_by_uniqueid().
      
      * A new function "ast_bridge_get_snapshot()" was created to retrieve
        the bridge snapshot directly from the bridge structure.
      
      * The ast_bridge_topic_all() function now returns a normal topic
        not a cached one so you can't use stasis cache functions on it
        either.
      
      * The ast_bridge_snapshot_type() stasis message now has the
        ast_bridge_snapshot_update structure as it's data.  It contains
        the last snapshot and the new one.
      
      * cdr, cel, manager and ari have been updated to use the new
        arrangement.
      
      Change-Id: I7049b80efa88676ce5c4666f818fa18ad1985369
      3667c5e1
    • Joshua Colp's avatar
      stasis: Segment channel snapshot to reduce creation cost. · 50ac85cb
      Joshua Colp authored
      When a channel snapshot was created it used to be done
      from scratch, copying all data (many strings). This incurs
      a cost when doing so.
      
      This change segments the channel snapshot into different
      components which can be reused if unchanged from the
      previous snapshot creation, reducing the cost. In normal
      cases this results in some pointers being copied with
      reference count being bumped, some integers being set,
      and a string or two copied. The other benefit is that it
      is now possible to determine if a channel snapshot update
      is redundant and thus stop it before a message is published
      to stasis.
      
      The specific segments in the channel snapshot were split up
      based on whether they are changed together, how often they
      are changed, and their general grouping. In practice only
      1 (or 0) of the segments actually get changed in normal
      operation.
      
      Invalidation is done by setting a flag on the channel when
      the segment source is changed, forcing creation of a new
      segment when the channel snapshot is created.
      
      ASTERISK-28119
      
      Change-Id: I5d7ef3df963a88ac47bc187d73c5225c315f8423
      50ac85cb
    • Joshua Colp's avatar
      stasis: Use an implementation specific channel snapshot cache. · d0ccbb33
      Joshua Colp authored
      Channels no longer use the Stasis cache for channel snapshots. Instead
      they are stored in a hash table in stasis_channels which reduces the
      number of Stasis messages created and allows better storage.
      
      As a result the following APIs are no longer available since the stasis
      cache is no longer used:
      ast_channel_topic_cached()
      ast_channel_topic_all_cached()
      
      The ast_channel_cache_all() and ast_channel_cache_by_name() functions
      now return an ao2_container of ast_channel_snapshots rather than
      a container of stasis_messages therefore you can't (and don't need
      to) call stasis_cache functions on it.
      
      The ast_channel_topic_all() function now returns a normal topic not
      a cached one so you can't use stasis cache functions on it either.
      
      The ast_channel_snapshot_type() stasis message now has the
      ast_channel_snapshot_update structure as it's data. It contains the
      last snapshot and the new one.
      
      ast_channel_snapshot_get_latest() still returns the latest snapshot.
      
      The latest snapshot is now stored on the channel itself to eliminate
      cache hits when Stasis messages that have the snapshot as a payload
      are created.
      
      ASTERISK-28102
      
      Change-Id: I9334febff60a82d7c39703e49059fa3a68825786
      d0ccbb33
  9. Nov 21, 2018
    • Corey Farrell's avatar
      astobj2: Remove legacy ao2_container_alloc routine. · 021ce938
      Corey Farrell authored
      Replace usage of ao2_container_alloc with ao2_container_alloc_hash or
      ao2_container_alloc_list.  Remove ao2_container_alloc macro.
      
      Change-Id: I0907d78bc66efc775672df37c8faad00f2f6c088
      021ce938
    • Corey Farrell's avatar
      astobj2: Create function to copy weak proxied objects from container. · bc7f4f4d
      Corey Farrell authored
      Create ao2_container_dup_weakproxy_objs to perform a similar function to
      ao2_container_dup.  This function expects the source container to have
      weakproxy objects, inserts the associated non-weak objects into the
      destination container.  Orphaned weakproxy objects are ignored.
      
      Create test for this new function and for ao2_weakproxy_find.
      
      Change-Id: I898387f058057e08696fe9070f8cd94ef3a27482
      bc7f4f4d
  10. Nov 19, 2018
    • George Joseph's avatar
      CI: Get job timeouts from environment · bcdfb903
      George Joseph authored
      The job timeouts were hard coded in the jenkinsfiles which
      means changes had to go through gerrit.  Now they are taken
      from the following environment variables (and their defaults) that
      can be set in Jenkins configuration...
      
      TIMEOUT_GATES =      "60 MINUTES"
      TIMEOUT_DAILIES =    "3 HOURS"
      TIMEOUT_REF_DEBUG =  "24 HOURS"
      TIMEOUT_UNITTESTS =  "30 MINUTES"
      
      Change-Id: I673a551c1780bf665a3bc160b245da574aa4bbab
      bcdfb903
    • George Joseph's avatar
      backtrace: Refactor ast_bt_get_symbols so it doesn't crash · ece5f801
      George Joseph authored
      We've been seeing crashes in libbfd when we attempt to generate
      a stack trace from multiple threads.  It turns out that libbfd
      is NOT thread-safe.  It can cache the bfd structure and give it to
      multiple threads without protecting itself.  To get around this,
      we've added a global mutex around the bfd functions and also have
      refactored the use of those functions to be more efficient and
      to provide more information about inlined functions.
      
      Also added a few more tests to test_pbx.c.  One just calls
      ast_assert() and the other calls ast_log_backtrace().  Neither are
      run by default.
      
      WARNING:  This change necessitated changing the return value of
      ast_bt_get_symbols() from an array of strings to a VECTOR of
      strings.  However, the use of this function outside Asterisk is not
      likely.
      
      ASTERISK-28140
      
      Change-Id: I79d02862ddaa2423a0809caa4b3b85c128131621
      ece5f801
  11. Nov 18, 2018
  12. Nov 17, 2018
    • George Joseph's avatar
      CI: Mount a tmpfs on /tmp for testsuite docker containers · f5e3832d
      George Joseph authored
      Change-Id: I0566d81b0852f22066cd76d58eae5f1fda5602aa
      (cherry picked from commit 73efe864)
      f5e3832d
    • George Joseph's avatar
      CI: Pass work directory to runTestsuite · be87185f
      George Joseph authored
      The testsuite can now use a user-specified work directory for
      all it's temp files.  This allows the docker containers to use
      a tmpfs backed directory for the temp files instead of it's
      own write-layer image.
      
      * runTestsuite.sh now accepts a --work-dir command line argument
        that gets exported as AST_WORK_DIR before running the testsuite.
      
      * gates.jenkinsfile now specifies --work-dir to be
        <testsuite_dir>/astroot.
      
      Since the Asterisk CI docker hosts now mount /srv/jenkins/workspace
      on a tmpfs, asterisk should be compiled and the testsuite run all in
      memory.
      
      Change-Id: If5ee905a15821296c355bb84cda38950ad8edc45
      (cherry picked from commit a335f4c9)
      be87185f
  13. Nov 16, 2018
    • George Joseph's avatar
      CI: Allow runUnittests to use 'expect' to run the tests · 8ff3435c
      George Joseph authored
      There seems to be a race condition between starting the asterisk
      daemon and attempting to use 'asterisk -r' that can cause the
      control socket file to not be created.  Since all of the Jenkins
      slaves have 'expect' installed, the runUnittests script can use
      it to start asterisk in the forground and issue the commands
      interactively.  This is much more reliable and it can also make
      startup errors more visible since they'll be in the Jenkins console
      output.
      
      If 'expect' isn't installed, the original daemon/asterisk -r
      process is used.
      
      Also added a "core show settings" before running the tests
      and added "notice,warning,error" to the console log.
      
      Change-Id: Idd656085f854afede813ac241b9e312b31358160
      8ff3435c
  14. Nov 13, 2018
  15. Oct 19, 2018
    • Corey Farrell's avatar
      astobj2: Eliminate legacy container allocation macros. · 687ab7ae
      Corey Farrell authored
      These macros have been documented as legacy for a long time but are
      still used in new code because they exist.  Remove all references to:
      * ao2_container_alloc_options
      * ao2_t_container_alloc_options
      * ao2_t_container_alloc
      
      These macro's are also removed.  Only ao2_container_alloc remains due to
      it's use in over 100 places.
      
      Change-Id: I1a26258b5bf3deb081aaeed11a0baa175c933c7a
      687ab7ae
  16. Oct 17, 2018
  17. Oct 04, 2018
  18. Oct 03, 2018
  19. Sep 26, 2018
  20. Sep 17, 2018
  21. Sep 14, 2018
  22. Sep 12, 2018
  23. Aug 27, 2018
    • Corey Farrell's avatar
      Create --disable-binary-modules option. · a2001c00
      Corey Farrell authored
      This new option can be passed for ./configure or
      ./tests/CI/buildAsterisk.sh to prevent download/install of binary
      modules.
      
      Normally enabling the categories MENUSELECT_CODECS or MENUSELECT_RES
      will result in binary modules being enabled even if the build target is
      incompatible with those modules.  This includes CI scripts which enable
      categories before disabling specific modules.
      
      If more binary modules are offered in the future this will help avoid
      accidentally downloading them if unwanted or incompatible.  Adding a
      binary module will only require creating a new menuselect entry similar
      to the existing ones, it will not be necessary to modify the CI scripts.
      
      Change-Id: I6b1bd1c75a2e48f05b8b8a45b7a7a2d00a079166
      a2001c00
  24. Aug 16, 2018
  25. Aug 08, 2018
    • Corey Farrell's avatar
      CI: Add support for coverage processing. · addfc938
      Corey Farrell authored
      Enable coverage with `./tests/CI/buildAsterisk.sh --coverage`.  This
      will cause Asterisk to be compiled with coverage support.  It also
      initializes 'before' coverage data for all sources.  Accept
      --tested-only to disable modules which are not run by any test.
      Enabling coverage also sets tested-only true by default.  To build
      everything with coverage enabled use `--coverage --tested-only=0`.
      
      ./tests/CI/processCoverage.sh is used to process the coverage and
      generate HTML reports.
      
      Fix utils/check_expr2 which failed to compiled with coverage enabled.
      
      Add status output 5 times per stage of astobj2_test_perf to ensure
      remote CLI does not timeout when compiled with coverage.  Remote CLI
      disconnects if no output is received for 60 seconds.  When coverage is
      enabled it takes about 70 seconds for my laptop to run the stages of
      this test, so with the change a message is printed every 14 seconds.
      
      Change-Id: I890f7d5665087426ad7d3e363187691b9afc2222
      addfc938
  26. Aug 01, 2018
    • Corey Farrell's avatar
      Build System: Improve ccache matching for different menuselect options. · a10a3aff
      Corey Farrell authored
      Changing any Menuselect option in the `Compiler Flags` section causes a
      full rebuild of the Asterisk source tree.  Every enabled option causes
      a #define to be added to buildopts.h, thus breaking ccache caching for
      every source file that includes "asterisk.h".  In most cases each option
      only applies to one or two files.  Now we only define those options for
      the specific sources which use them, this causes much better cache
      matching when working with multiple builds.  For example testing code
      with an without MALLOC_DEBUG will now use just over half the ccache
      size, only main/astmm.o will have two builds cached instead of every
      file.
      
      Reorder main/Makefile so _ASTCFLAGS set on specific object files are all
      together, sorted by filename.  Stop adding -DMALLOC_DEBUG to CFLAGS of
      bundled pjproject, this define is no longer used by any header so only
      serves to break cache.
      
      The only code change is a slight adjustment to how main/astmm.c is
      initialized.  Initialization functions always exist so main/asterisk.c
      can call them unconditionally.  Additionally rename the astmm
      initialization functions so they are not exported.
      
      Change-Id: Ie2085237a964f6e1e6fff55ed046e2afff83c027
      a10a3aff
Loading