Commit Graph

807 Commits

Author SHA1 Message Date
Vadim Yanitskiy f6974d89c8 scripts: add a script for checking presence of <endian.h>
Change-Id: I6a1e7fc2e96f42fc596f47b4d7f1ac6c61d834b6
2021-10-30 01:09:58 +03:00
Oliver Smith 3dad8b5e7f OBS: nightly: fix missing checkout osmo-hnodeb
Fixes: 2ab3f7 ("Build and test osmo-hnodeb nightly packages")
Related: https://jenkins.osmocom.org/jenkins/job/Osmocom_OBS_nightly/1044
Change-Id: I327adaa8f60c1f90aa150e9d4fba5a10f271c96b
2021-10-26 08:17:55 +02:00
Vadim Yanitskiy 72e42f70d5 coverity: disable Doxygen when building projects
Change-Id: I2fe2f80eb3ec00e9b6c0a3c0ee96e1a0da217b27
2021-10-25 10:00:24 +00:00
Pau Espin 2ab3f7d4dc Build and test osmo-hnodeb nightly packages
Change-Id: I53c2b357b0669f5101ceec7896c4ba30e69605c2
2021-10-25 11:06:50 +02: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
Pau Espin 8b8051689f coverity/build_Osmocom.sh: Fix trailing whitespace
Change-Id: I999c112c27d243366a010f216749a067d7b0509d
2021-10-21 12:52:37 +02:00
Vadim Yanitskiy f37d4fee7a coverity: enable parallel build for libsmpp34
We have parallel build enabled in libsmpp34.git since 2018.

Change-Id: Ibe57a8c823d9b35e2f51c9bd7a13d6baf61bf0ca
Related: Id41fbcb5a96093eb6c3dc00bcacbd379111ada70
2021-10-20 21:44:14 +03:00
Vadim Yanitskiy 5b72401b59 lint/checkpatch: ignore csn1_(enc|dec).c files in osmo-pcu.git
Change-Id: I5f8c83e3a8b9f5280779d6a6cf0736b9d3f4e958
Related: I7d1b1f7e6d7f89b052b3fd73a960419bb2673020
2021-10-20 21:25:31 +03:00
Oliver Smith b00eb7b012 lint: osmo-pcu: exclude imported wireshark code
Related: OS#5087
Change-Id: I70814512bdba50363edd4195b5b073698ea6532c
2021-10-08 14:15:40 +02:00
Oliver Smith b228c23e08 lint: support project-specific exclude paths
While at it, put in the exact path to spelling.txt in osmo-ci.git.

Related: OS#5087
Change-Id: Ib23f9c65da1916ebf4654c5e641eaffe6c75315c
2021-10-08 14:15:09 +02:00
Oliver Smith c1bdb5b9ce build-old-tags: mark osmo-msc 1.7.0 as known error
Old osmo-msc releases failed to build because logging output of
libosmo-mgcp-client has changed. I'm backporting the fix as 1.7.1 and
1.6.4. The script builds the last 3 releases (1.6.4, 1.7.0, 1.7.1), so
mark 1.7.0 as known error.

Related: osmo-msc Id197e4ab9ba12e284299ef520edee9c362513bf1
Change-Id: I86f8252d450165f4be3d7c97fa70235638f7dd96
2021-09-16 11:02:57 +02:00
Oliver Smith 477218474f lint: checkpatch_osmo.sh: ignore debian/changelog
Auto-generated from commit log, may contain spelling errors.

Fixes: OS#5232
Change-Id: Id0ccfbff73464dac7f7f939c88a9e2677fa2a37f
2021-09-15 16:41:18 +02:00
Oliver Smith cbc58a6874 lint: checkpatch.pl: add STRCPY_OSMO
Add Osmocom specific check to forbid using strncpy() and strcpy().
Instead, osmo_strlcpy() or OSMO_STRLCPY_ARRAY() should be used.

Related: OS#5087
Related: https://lists.osmocom.org/pipermail/openbsc/2021-September/013538.html
Change-Id: I6fa96c8f3d15110dd3d3509faa593285a78f469e
2021-09-15 11:08:40 +02:00
Oliver Smith 654cfb3192 lint: checkpatch_osmo.sh: ignore UNSPECIFIED_INT
As suggested by Pau, let's remove this check because it isn't useful for us.

Related: OS#5087
Change-Id: I15345a154f490362093e46fc0df75e75bbb237fe
2021-09-13 10:37:06 +02:00
Oliver Smith 94cf194666 lint: checkpatch_osmo.sh: ignore UNNECESSARY_INT
Related: https://gerrit.osmocom.org/c/libosmocore/+/25345/4#message-8f6827dc90942698d23ebb909544bf60fa461b2d
Related: OS#5087
Change-Id: I5be890a296b37511affc17cb786f0709de822826
2021-09-13 10:32:15 +02:00
Oliver Smith a18e6dfa40 jobs/ttcn3-testsuites.yml: add ns-test-sgsn-sns
Depends: docker-playground I1a9205885d381c04141dad752de0b39d9268ab69
Change-Id: Ifb08fafa408b8c622998080b4ec2932b0c3fd3bb
2021-09-08 08:14:49 +02:00
Oliver Smith 1658ff58aa jobs/gerrit-lint.yml: add lint jobs
Related: OS#5087
Change-Id: Ic473a5c535dfbdda55751e53fc751ede1adde7e2
2021-09-06 10:56:26 +00:00
Oliver Smith 4f75177e8c lint: checkpatch_osmo.sh: ignore LONG_LINE_*
According to a comment in checkpatch.pl, these should automatically be
ignored when LONG_LINE is ignored. However I found that it's still
complaining about LONG_LINE_COMMENT, so explicitly disable it.

Related: OS#5087
Change-Id: I7aed3bfbfcb0b9e2f1d743b111e8418846f031d2
2021-09-03 08:27:28 +00:00
Oliver Smith d314ae8280 OBS: remove {osmo-gsm-manuals,osmo-trx}-debian8
Drop these workarounds, as we are not building binary packages for
debian 8 anymore.

Related: OS#5223
Change-Id: Ibe7ba124557969df62798ba49c4489e9606c2341
2021-09-01 16:49:53 +02:00
Oliver Smith 8cbd4bf779 lint: ignore EMBEDDED_FILENAME
Mentioning the file in itself is useful sometimes (e.g. when explaining
how to use a contrib script). So do not let the linter fail here.

Related: OS#5087
Change-Id: I151b97bc7f2fe83898c0598db54360807956993c
2021-08-16 11:27:11 +02:00
Oliver Smith 20901e849e repo-install-test: osmo-pcap-server: !latest
Disable osmo-pcap-server for latest again, as the port is still
conflicting there with osmo-bts.

Fixes: 7ca9c4 ("repo-install-test: clear SERVICES_NIGHTLY list")
Related: OS#5203
Change-Id: I711e0e13c3e3af30407b85fd10aca9446f2b94ba
2021-08-09 16:11:08 +02:00
Oliver Smith 7ca9c4f33d repo-install-test: clear SERVICES_NIGHTLY list
All services that start up in nightly should also start in the latest
release now, as new versions have been released of related programs.

Change-Id: Idc94270978ec5ca67d6f7e20e009f905e972f984
2021-08-05 19:06:55 +02:00
Oliver Smith b70fede452 lint: ignore LONG_LINE
With recent code reviews I've realized that in Osmocom we do often use
more than 120 characters per line for various reasons. So adjust the
linter to not fail anymore if that is the case.

Related: https://gerrit.osmocom.org/c/osmo-pcu/+/25056/4/src/tbf_ul_ass_fsm.h#32
Related: https://gerrit.osmocom.org/c/osmo-msc/+/25076/1/src/libmsc/msc_a.c#125
Related: OS#5087
Change-Id: I88fd86ac550fddb3017aeceb647c3d9e75367372
2021-07-30 10:11:11 +02:00
Oliver Smith dc66e9a394 lint: exclude kdf, milenage for libosmocore
Imported code that doesn't follow our guidelines (e.g. spaces used
instead of tabs).

Related: OS#5087
Change-Id: Iccf59d66f35ede9710258faf9d4257584214bb17
2021-07-19 14:39:43 +02:00
Oliver Smith dbc4e6e78f lint: checkpatch.pl: no spaces required for tdef
Don't require spaces around equals sign for tdef entries.

Related: OS#5087
Change-Id: I1f0b9ed5bd49ef9b5ab0e347b9260e71df34ff9c
2021-07-19 14:39:39 +02:00
Oliver Smith bedf7ed0fb lint: checkpatch.pl: complain about %i in printf
Pau has to remind me often that %d is used instead of %i in Osmocom
trees, so let's automate it.

Complain like this:
src/vty/command.c:3052: WARNING:PRINTF_I_OSMO: Use %d instead of %i

Related: OS#5087
Change-Id: I1a98326f1cbf4d2e0bb948558e5cd1726b0a9868
2021-07-15 10:21:47 +02:00
Oliver Smith 7f0fdda23c lint: ignore PREFER_DEFINED_ATTRIBUTE_MACRO
Don't complain that macros such as __packed should be used, which are
defined in the Linux kernel but not in libosmocore.

For example:
src/gsm/gsm0808.c:85: WARNING:PREFER_DEFINED_ATTRIBUTE_MACRO: Prefer __packed over __attribute__((packed))

Related: OS#5087
Change-Id: I2bf3b7d60e99cf91f7b619af54167a11cdfae8c6
2021-07-15 10:21:47 +02:00
Oliver Smith 7c3c0bdaa5 lint: ignore DEEP_INDENTATION
Related: OS#5087
Change-Id: Iff29f0a97dbfed904705f543541441f761370602
2021-07-15 10:21:47 +02:00
Oliver Smith 972e8bcbb0 lint: ignore PREFER_FALLTHROUGH
Related: OS#5087
Change-Id: I373a231cf08fd23312ad9a85d8e2855a736e331a
2021-07-15 10:21:47 +02:00
Oliver Smith b6e2adb0aa lint: checkpatch.pl: allow spaces below (g)DEFUN
Do not complain if indenting with exactly 6/7 spaces below (g)DEFUN(,
as it's often done in VTY-related code in Osmocom. This patch assumes
that if the line starts with 6/7 spaces and " or a word, it's probably
below DEFUN( or gDEFUN(. I've considered implementing a more accurate
check, but that would be too much effort (e.g. when more macros are
involved).

Other related macros, such as DEFUN_ATTR are longer. Indentation below
those should be done with one tab (+ spaces for padding), the linter
doesn't need to be adjusted for those.

Related: OS#5087
Change-Id: I0934b63a62500e7a3e09c753cc63aa331e580cc6
2021-07-15 10:21:05 +02:00
Oliver Smith 444ca841e6 lint: checkpatch.pl: fix && complaints
Don't complain with:
	ERROR:SPACING: space prohibited after that '&&' (ctx:ExW)
in code similar to:
	if (conn->conn->mode != MGCP_CONN_LOOPBACK
	    && conn->conn->mode != MGCP_CONN_RECV_ONLY
	    && !mgcp_rtp_end_remote_addr_available(&conn->end)) {

The check was supposed to complain about spaces if the && is used as
unary operator (to get the address of a goto label). But it's clearly
producing false positives in the Osmocom context with use as non-unary
operator, so remove this check.

Related: OS#5087
Related: 0d413866c7
Change-Id: I7ce79e6b291b3a3dab6587a589eeef0a0bc53de9
2021-07-07 11:28:38 +02:00
Oliver Smith 5409188d55 lint: ignore LINE_CONTINUATIONS
Causes false positives, e.g. in tests/mgcp/mgcp_test.c in osmo-mgw:

  #define MDCX4_PT2 \
	"MDCX 18983218 1@mgw MGCP 1.0\r\n" \
	"M: sendrecv\r" \
	"C: 2\r\n" \
	"I: %s\r\n" \
	"L: p:20-20, a:AMR, nt:IN\r\n" \
	...

tests/mgcp/mgcp_test.c:189: WARNING:LINE_CONTINUATIONS: Avoid unnecessary line continuations

Related: OS#5087
Change-Id: I8d8004f2a8ef926588487187af7cdef8254c7248
2021-07-07 11:28:38 +02:00
Oliver Smith 2cceff4535 lint: ignore COMPLEX_MACRO
Complains about, for example:
  #define MDCX4 \
	"MDCX 18983217 1@mgw MGCP 1.0\r\n" \
	"M: sendrecv\r" \
	"C: 2\r\n" \
	"I: %s\r\n" \
	"L: p:20, a:AMR, nt:IN\r\n" \
	"\n" \
	"v=0\r\n" \
	"o=- %s 23 IN IP4 5.6.7.8\r\n" \
	"c=IN IP4 5.6.7.8\r\n" \
	"t=0 0\r\n" \
	"m=audio 4441 RTP/AVP 99\r\n" \
	"a=rtpmap:99 AMR/8000\r\n" \
	"a=ptime:40\r\n"

Related: OS#5087
Change-Id: Ic9d752ca841161a62e3631c84b4237a0d8594363
2021-07-07 11:28:38 +02:00
Oliver Smith 497ce6743a lint: exclude *.ok, *.err
Complains about e.g. \r\n in *.ok files.

Related: OS#5087
Change-Id: I79004cec3e2eb753951a7f886318ac0db4ea2c06
2021-07-07 11:28:37 +02:00
Oliver Smith 57804faacc lint: checkpatch.pl: exclude pattern, not dir
Allow to exclude files in a follow-up commit, not just directories.

Related: OS#5087
Change-Id: Ic3990fba60060c331c479174183924b9cdbdb4c8
2021-07-07 11:28:16 +02:00
Oliver Smith d58b999e0f lint: add helper scripts
Add lint_diff.sh, which runs checkpatch on git diff to either HEAD~1 (if
the tree is clean) or HEAD. This can be used as pre-commit hook, and
it's what jenkins will run.

Add lint_all.sh, which runs checkpatch on a whole repository to test if
the rules we are checking for make sense in Osmocom context.

Related: OS#5087
Change-Id: I1d02c169b05fb05b87209a444a5ddb86efc99d04
2021-06-16 16:49:47 +02:00
Oliver Smith 1e750ed6dc lint/checkpatch: add Osmocom specific wrapper
Related: OS#5087
Change-Id: I0ec6a3bc57a4d31c821fa83370f05c6d4ac2a5b0
2021-06-16 16:42:18 +02:00
Oliver Smith 6c497c076b lint/checkpatch: add --exclude argument
Apply patch from https://review.coreboot.org/c/coreboot/+/18568/, so we
can exclude specific directories.

Related: OS#5087
Change-Id: Ia980814895249f839873c5002f0d21c0e59ee01d
2021-06-16 16:42:18 +02:00
Oliver Smith 47ba23b820 lint/checkpatch: import from Linux kernel
Prepare to run checkpatch on patches submitted to gerrit to point out
various linting errors automatically, such as { after functions not
placed on a new line, or common spelling errors.

Import version from 7e6cdd7f ("checkpatch: improve ALLOC_ARRAY_ARGS test")
of linux.git.

Related: OS#5087
Related: https://osmocom.org/projects/cellular-infrastructure/wiki/Linting
Change-Id: I58571a0409e79d88d37e8328f41a540a58cfb198
2021-06-16 16:41:56 +02:00