Commit Graph

90 Commits

Author SHA1 Message Date
Vadim Yanitskiy 0e2604dae0 coverity: build osmo-hnbgw with '--enable-pfcp'
This should improve the analysis depth for osmo-hnbgw.

Change-Id: I33b44a1c2ffde80b000b41b78569ff2f55bc98ed
2023-12-12 14:52:16 +00:00
Oliver Smith 4cf490967c coverity: add job to check for failed uploads
Related: SYS#6685
Change-Id: Ideabcb30f9f8f365acff2de7751eb74a2762a7a6
2023-12-08 14:53:40 +01:00
Oliver Smith 0bdf874252 coverity: readlink /opt/coverity/current
Show where the symlink points at the start of the job, so we can see
which coverity version is currently installed.

Related: SYS#6685
Change-Id: If4a7c71759a6eb436eb47024565f169c6134e2e2
2023-12-08 13:40:19 +00:00
Oliver Smith 56bc906eed coverity: run inside docker
Run the coverity job inside docker, so all depends are available (fixes
that it currently fails because liburing isn't available for
libosmocore).

Depends: docker-playground I25862a7e3c8a73e13fd4a9237ab57500d8dfc95c
Change-Id: I5cfdb6b2e12e176ff6d6ed6c1b8505d7694993f9
2023-08-25 13:32:59 +02:00
Oliver Smith 6dde3dcd38 coverity: build osmo-ggsn with --enable-gtp-linux
Change-Id: I5b240dbfe2369a5a54ab6115a8780cf9cc36b537
2023-02-01 12:06:16 +01:00
Oliver Smith 56939cc0a7 coverity/local_test: use all CPU cores
Change-Id: I018fda7cb85bb7e480dbc55d296c2e216098fc5e
2023-02-01 11:30:11 +01:00
Oliver Smith 6a6b19ec6f coverity: check if sdcc is installed
Check at the start if sdcc is installed, as it's required to build
libusrp. It might not be installed when testing locally.

Change-Id: I226f439f7eff657d01c667aae464c080b91d5a82
2023-02-01 10:58:04 +01:00
Oliver Smith 7bd02257c9 coverity/local_test: fix copy error
coverity/common.sh is a symlink to ../scripts/common.sh in this git
repository. The local_test.sh already adjusts the symlink so it points
to the right place after copying related scripts to /tmp/coverity.
However when running the script again, cp would fail with:

cp: '/home/user/code/osmo-dev/src/osmo-ci/coverity/common.sh' and '/tmp/coverity/common.sh' are the same file

Remove the symlink to avoid this error.

Change-Id: I081871e6e06547a90879bc4aa08ac2b5c5ddaeef
2023-02-01 10:58:04 +01:00
Oliver Smith 2f0de239e6 coverity: disable building osmo-isdntap
As it doesn't seem to build properly with default dahdi-linux, disable
it for now.

Related: OS#5886
Change-Id: Icb5cf7517a2ba0f3abb1d44337677f9502069ec6
2023-02-01 10:58:04 +01:00
Oliver Smith 9a637bc596 coverity: osmo-remsim: fix install errors
Set usbdropdir and serialconfdir to fix:
  /usr/bin/mkdir -p '/usr/lib/pcsc/drivers/libifd-osmo-remsim-client.bundle/Contents'
  /usr/bin/mkdir: cannot create directory ‘/usr/lib/pcsc’: Permission denied

Change-Id: I08e72bb06a823752154fe3e2011a42c144c657c4
2023-02-01 10:58:04 +01:00
Oliver Smith 2584debad5 coverity: add libgtpnl
Fix for:
  configure: error: Package requirements (libgtpnl >= 1.2.0) were not met

Change-Id: I534b8a550061e52d4c5ab95ad98e146a77f386bc
2023-02-01 10:58:04 +01:00
Harald Welte 8abf46760a coverity: Add many missing projects
Add the following projects to our coverity test job:
  osmo-pcap
  osmo-e1d
  osmo-e1-recorder
  osmo-upf
  osmo-isdntap
  osmo-uecups
  osmo-remsim

Change-Id: Idee49aa4c15fcfb1a469db9e4978523af5608d70
2023-01-31 13:29:48 +01:00
Vadim Yanitskiy be18bcd4ed coverity: build osmo-trx with MS TRX (--with-mstrx)
Change-Id: I4fbb052eacd8e6b8ddb8130d2e280a248719b250
Related: OS#5599
2022-12-29 18:12:39 +07:00
Harald Welte 4fdee2a0fc coverity: git pull --recursive / update submodules
osmo-trx has just started to use submodules, so let's add the
related git commands here.

Closes: OS#5846
Related: osmo-trx.git Change-Id I36c65a8c725c4da76dc70006cd96b0a2b6878e84
Change-Id: I876fa0152268bd7a43ca4c452d75c26ebadf7a6e
2022-12-27 18:18:29 +01:00
Vadim Yanitskiy 581a7ea879 coverity: fix prepare_source_Osmocom.sh terminating early
Since [1] was merged this script is executed with '-xe' making it
fail immediately if a command returns a non-zero code.  grep may
return 1 if pattern is not found, so let's suspend it.

Change-Id: I21a01478b64015fd699ed31634bf2fb1dc8f6750
Fixes: [1] Icf6546271a01cd9a3dab1ce0d1bc02807d08ad85
2022-10-04 17:00:01 +07:00
Vadim Yanitskiy 6b3b90d55d coverity/prepare_source_Osmocom.sh: execute with '-xe'
Change-Id: Icf6546271a01cd9a3dab1ce0d1bc02807d08ad85
2022-10-01 17:42:39 +07:00
Oliver Smith 6c7a2076cf coverity: use osmo_git_clone_url
Stop cloning from git.osmocom.org by using the shared function.

Change-Id: I17590d0b0b46274e2ceb007e20d7d1dc039f4e8d
2022-09-26 14:50:47 +02:00
Oliver Smith 204ad54e93 coverity/prepare_source_Osmocom: remove test -d
This was redundant, mkdir -p doesn't error if the directory structure
exists.

Change-Id: Ic6253ecb9bfd5f8b2d744988b8825ef90e2e6d5e
2022-09-26 14:50:47 +02:00
Harald Welte 5455b42405 update git URLs (git -> https; gitea/gerrit)
Unencrypted git:// protocol offers no integrity or authentication,
making it subject to tampering.  Use https:// instead.

https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git
https://blog.readthedocs.com/github-git-protocol-deprecation/

Change-Id: Ia44e4127ff87a3d4d747225d3258188a0a891f1b
2022-08-13 04:02:51 +07:00
Vadim Yanitskiy ac0b663951 {jobs,coverity}: add a new project - libosmo-gprs
Change-Id: I83e86084e9f7a7431bf5a70c372da1f9ccd28436
2022-08-10 04:39:36 +07:00
Vadim Yanitskiy 6d81605790 coverity: add missing libosmo-pfcp, dependency of osmo-upf
Since recently [1] osmo-upf depends on libosmo-{gtlv,pfcp}.so, which
are provided by libosmo-pfcp.git.  We need to build libosmo-pfcp
before attempting to build osmo-upf, otherwise it fails:

  configure: error: Package requirements (libosmo-gtlv >= 0.1.0) were not met:

  Package libosmo-gtlv was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libosmo-gtlv.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'libosmo-gtlv', required by 'world', not found

Change-Id: Ic4fe7b40cf9a57e0462b2c0806f8810fcc04a10c
2022-08-09 15:19:19 +07:00
Oliver Smith 0b2de357a9 Cosmetic: coverity: how to add a new project
Mention that new projects should be added to the components list, as a
lot of projects were not listed there. I've just added all missing
ones. Put it as comment in prepare_source_Osmocom.sh because that's
probably the most likely spot where people will see it while adding a
new project.

Change-Id: I48630f4eb5b4f2b7b714697d15432c0d71f136f9
2022-07-13 07:47:14 +00:00
Oliver Smith ff94d1def5 jobs/coverity: don't cd ~/osmo-ci/coverity
Run the coverity/jenkins.sh from the osmo-ci.git repository that jenkins
checks out at the beginning of the build, instead of using a copy in ~/
that is updated whenever pushing to master. This makes it less
confusing, I configured the job to use a WIP branch and didn't realize
that it still used the code from master.

Change-Id: Ie992d71d2afec6982447b8fe3626c821a9e48d19
2022-07-12 14:44:52 +02:00
Oliver Smith c42a20a8f1 coverity: don't build tests for all
The coverity jenkins job has been failing since we tried to build tests
for all projects (and in an earlier attempt, build and run tests for all
projects). Make the coverity job work again by skipping build of tests
for asn1c. I looked into it earlier and the cause wasn't obvious to me,
and it's currently not worth spending time on.

Fix for:
libtool:   error: cannot find the library '../../skeletons/libasn1cskeletons.la' or unhandled argument '../../skeletons/libasn1cskeletons.la'

Change-Id: Iba0bfe0e753812058436eaf515391eb1f4b09951
2022-07-12 13:44:06 +02:00
Vadim Yanitskiy 2be279a9e0 fixup: coverity: compile tests, but not execute them
In change 82265bc46d [1] I attempted
to fix aaeab8c976 [2], however both
pushd and popd commands are not available in plain shell.

Change-Id: Ib63ded66781c774e16773537c3b943237904b03e
Fixes: [1] I92b648cd1e80399561067eae99426faed1ff1e25
Fixes: [2] Idf0714a59356633021be21acc47f9471d059b7fe
2022-07-04 16:57:33 +07:00
Vadim Yanitskiy 82265bc46d fixup: coverity: compile tests, but not execute them
Change-Id: I92b648cd1e80399561067eae99426faed1ff1e25
Fixes: Idf0714a59356633021be21acc47f9471d059b7fe
2022-07-04 15:42:11 +07:00
Vadim Yanitskiy aaeab8c976 coverity: compile tests, but not execute them
Compiling unit tests would allow Coverity to analyze them too and thus
find more bugs.  The problem is that binaries listed in check_PROGRAMS
are not compiled during 'make all', but only during 'make check'.

One approach [1] is to run 'make check' in do_build(), however it breaks
'Coverity-Upload' job because some unit tests are failing.  This is why
I had to revert bf84ba9f69 together with
ae41942214 that was supposed to fix it.

Even if all unit tests were passing, we still don't want to execute them
because running tests is beyond the scope of 'Coverity-Upload' job.

Another approach is to patch Makefile.am files replacing check_PROGRAMS
with noinst_PROGRAMS, so that the test binaries are compiled during
'make all' but not executed.

Change-Id: Idf0714a59356633021be21acc47f9471d059b7fe
Related: [1] I3f3149a61df96646798c72d0ad31c41b97e6b81f
2022-07-04 14:39:30 +07:00
Vadim Yanitskiy 618f171cb1 Revert "coverity/build_Osmocom.sh: run 'make check' in do_build()"
This reverts commit bf84ba9f69.

Change-Id: I722f8cbb1934a4f5ce2969e243f223019f123777
2022-07-04 14:38:45 +07:00
Vadim Yanitskiy 9baa805a74 Revert "coverity/build_Osmocom.sh: don't do check for all"
This reverts commit ae41942214.

Change-Id: I5018e0da020f32e3a46a2772e79794e5a3a686ca
2022-07-04 14:38:45 +07:00
Oliver Smith ee5920f95d coverity/local_test.sh: new file
Add the script I've used to locally reproduce the build failure and fix
it.

Change-Id: I12241499a0669559bc40eb3e76f967a7c6a2dc70
2022-06-30 15:31:37 +02:00
Oliver Smith 26a02acdf0 coverity/prepare_source: add SRC_SKIP_FETCH/CLEAN
When running these scripts locally while developing, it's more useful to
not fetch the sources and clean the git repository instead. Add
environment variables that allow doing this.

Change-Id: Id6d3cdabb776435df36c0145d93e514693062fca
2022-06-30 15:30:00 +02:00
Oliver Smith 12630c87ab coverity/prepare_source: fix running twice
Don't attempt to clone layer1-api if it exists already. Jenkins deletes
the sources for every run, but for development it is useful to be able
to run this script multiple times without getting errors.

Change-Id: I17bd76a5ff6abafd4bd0189073930f45de20afe8
2022-06-30 12:27:07 +02:00
Oliver Smith ae41942214 coverity/build_Osmocom.sh: don't do check for all
'make check' does not pass for asn1c, it fails with the following. I
looked into it and the cause is not obvious to me, so in order to make
the jenkins job pass again I've changed it back to just run 'make'
instead.

Fix for:
  ...
  fatal: making test-suite.log: failed to create ../tests/98-attribute-class-OK.asn1.log
  fatal: making test-suite.log: failed to create ../tests/99-class-sample-OK.asn1.trs
  fatal: making test-suite.log: failed to create ../tests/99-class-sample-OK.asn1.log
  Makefile:735: recipe for target 'test-suite.log' failed
  make[3]: *** [test-suite.log] Error 1
  make[3]: Leaving directory '/home/osmocom-build/osmo-ci/coverity/source-Osmocom/asn1c/libasn1fix'
  Makefile:841: recipe for target 'check-TESTS' failed

Disable 'make check' for libusrp too as it also didn't pass:

  Making check in usrp2
  make[4]: Entering directory '/tmp/coverity/source-Osmocom/libusrp/firmware/src/usrp2'
  test -f `basename 'eeprom_boot.a51'` || ln -s 'eeprom_boot.a51' .
  test -f ../common/`basename 'eeprom_boot.a51'` -o \
          \! -f `dirname 'eeprom_boot.a51'`/../common/`basename 'eeprom_boot.a51'` \
          || ln -s `dirname 'eeprom_boot.a51'`/../common/`basename 'eeprom_boot.a51'` ../common/`basename 'eeprom_boot.a51'`
  sdas8051 -plosgff `basename 'eeprom_boot.a51'`
  sdcc -mmcs51 --no-xinit-opt -I../../../firmware/include -I../../../firmware/src/usrp2 -I../../../firmware/src/common -I../../../firmware/src/common -DHAVE_USRP2 \
          -c -o eeprom_init.rel `test -f 'eeprom_init.c' || echo './'`eeprom_init.c
  test -f `basename '_startup.a51'` || ln -s '_startup.a51' .
  test -f ../common/`basename '_startup.a51'` -o \
          \! -f `dirname '_startup.a51'`/../common/`basename '_startup.a51'` \
          || ln -s `dirname '_startup.a51'`/../common/`basename '_startup.a51'` ../common/`basename '_startup.a51'`
  sdas8051 -plosgff `basename '_startup.a51'`
  make[4]: *** No rule to make target '../../lib/libfx2.lib', needed by 'eeprom_boot.ihx'.  Stop.

All other 'make check' calls do work as expected, the build script runs
through again with this patch.

Fixes: bf84ba9f ("coverity/build_Osmocom.sh: run 'make check' in do_build()")
Change-Id: I6b9eb8e73c51d925897579fb51bc0a1e86e77270
2022-06-30 12:25:56 +02:00
Oliver Smith ea1172056f coverity/prepare_source_Osmocom.sh: fix typo
Osm_c_ocom -> Osmocom

Change-Id: Ib5a8f35eb9ef3bb8488b29ed9a9b7f43e6b6f088
2022-06-30 11:26:24 +02:00
Vadim Yanitskiy bf84ba9f69 coverity/build_Osmocom.sh: run 'make check' in do_build()
This enables building and running tests (check_PROGRAMS), so that
Coverity will be able to find bugs in their code too.

Change-Id: I3f3149a61df96646798c72d0ad31c41b97e6b81f
2022-06-29 13:40:16 +00:00
Oliver Smith 8637f74ced coverity: add osmo-bsc-nat
Fixes: OS#5596
Change-Id: Id7cf497ea15c3ccdf76c047c6a67f17fac94e0dd
2022-06-28 12:11:15 +02:00
Pau Espin 702fd8ff94 Add new repo osmo-hnbgw (nightly) to build jobs and scripts
Change-Id: I2fdbd651e4b50191e1a67e183590de99d6366ca5
2022-01-05 11:39:41 +01:00
Vadim Yanitskiy 72e42f70d5 coverity: disable Doxygen when building projects
Change-Id: I2fe2f80eb3ec00e9b6c0a3c0ee96e1a0da217b27
2021-10-25 10:00:24 +00:00
Pau Espin 2146640769 Add osmo-hnodeb to ansible/jenkins/coverity setup
Change-Id: Ie4b03aefeda13d216706bd648145689cf2ef93bb
2021-10-25 11:06:48 +02:00
Vadim Yanitskiy 1dcc508ce6 coverity: fix build_simtrace2(): generate Makefile using autotools
Starting from I57e77f927ee9e169cc794c5dc6b128a2d590201b, autotools
are required in order to configure and build the project.

Change-Id: I48696af1ccb5eb884f5de9085bcda37fc41766fb
Fixes: I74da8b523c9d51887d5eceb01ca0f505bb846812
2021-10-24 16:44:29 +03:00
Vadim Yanitskiy c2b01a9b81 fixup: coverity: also build and check SIMTrace host tools
Change-Id: I97b173a4b3fe47a119145e8d6fa0ad116fd38237
2021-10-24 13:22:00 +03:00
Vadim Yanitskiy d304d61327 coverity: also build and check osmo-{cbc,gbproxy}
Change-Id: Ibbff2bdf3163ba33dac11ccaa2e405894a7a0f10
2021-10-21 22:16:04 +03:00
Vadim Yanitskiy 56489bc521 coverity: also build and check SIMTrace host tools
Change-Id: I74da8b523c9d51887d5eceb01ca0f505bb846812
2021-10-21 22:16:04 +03:00
Vadim Yanitskiy 27e5f8ac15 coverity: build osmo-trx with USRP1 support
This allows Coverity to analyze the libusrp specific code.

Change-Id: I36df72149a32cb0df43c74af910d1fbb92b88f4a
2021-10-21 22:16:04 +03:00
Vadim Yanitskiy 0909dade00 coverity: build osmo-trx with UHD+LMS+IPC support
This allows Coverity to analyze the UHD/LMS/IPC specific code.

Change-Id: Ib58bee277414596cb46e523c798d42514c0eb78d
2021-10-21 22:16:04 +03:00
Vadim Yanitskiy baee7c45e0 coverity: build osmo-msc with --enable-smpp
This allows Coverity to analyze the SMPP specific code.

Change-Id: Ie1e4f1610d86fe57d940527ac64d3d1beb7165e0
2021-10-21 22:16:04 +03:00
Vadim Yanitskiy a2e790e763 coverity: build osmo-{msc,sgsn} with --enable-iu
This allows Coverity to analyze the Iu (UMTS) specific code.

Change-Id: I3ef08fcf42950b33e18b3bfcddff890547308364
2021-10-21 22:16:04 +03:00
Vadim Yanitskiy b25ffe1356 coverity: allow passing configure args to build_default()
Change-Id: I79aa2c65cd0d3b06c0bd9ec4f44288b21e40c3b7
2021-10-21 22:15:54 +03:00
Vadim Yanitskiy 7e053f3a23 coverity: also specify --with-sysmobts for osmo-pcu
It's present in build_osmobts(), so let's add it for consistency.

Change-Id: Ie17e2f9f81258e4d60c8cecf0a7af38e8372f9dd
2021-10-21 22:01:39 +03:00
Vadim Yanitskiy acf98b8ec0 coverity: drop --enable-sysmocom-bts for osmo-pcu
There is no such parameter in osmo-pcu's configure script.

Change-Id: I7f06f3d804acd97526a9eb0f93a23375ec555ee8
2021-10-21 22:01:39 +03:00