Change in gr-gsm[master]: apps/grgsm_trx: migrate from getopt to argparse

2018-09-11 Thread Piotr Krysik
Piotr Krysik has posted comments on this change. ( 
https://gerrit.osmocom.org/10832 )

Change subject: apps/grgsm_trx: migrate from getopt to argparse
..


Patch Set 1: Verified+1 Code-Review+2

(2 comments)

This is not just rework of the previous change, some of my changes were just 
thrown away without explanation. See the comments.

https://gerrit.osmocom.org/#/c/10832/1/apps/grgsm_trx
File apps/grgsm_trx:

https://gerrit.osmocom.org/#/c/10832/1/apps/grgsm_trx@55
PS1, Line 55: argv
_hz suffix is redundant, of course frequency is in Hz


https://gerrit.osmocom.org/#/c/10832/1/apps/grgsm_trx@71
PS1, Line 71:   self.radio.freq_offset_hz = 
self.phy_freq_offset_hz
this should be passed as parameter to radio_if, there is no reason to set it to 
None in any circumstances, it can safely be 0 by default



--
To view, visit https://gerrit.osmocom.org/10832
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I24a17b4cd44db0ce95a19d7470f4f09f3c85a26d
Gerrit-Change-Number: 10832
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Comment-Date: Tue, 11 Sep 2018 07:41:49 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in gr-gsm[master]: grgsm_scanner: Add --debug option

2018-09-11 Thread Piotr Krysik
Piotr Krysik has posted comments on this change. ( 
https://gerrit.osmocom.org/10784 )

Change subject: grgsm_scanner: Add --debug option
..


Patch Set 1: Verified+1 Code-Review+2


--
To view, visit https://gerrit.osmocom.org/10784
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I11e99facb5a1ab9c9bfee3c314a91a74f98a2523
Gerrit-Change-Number: 10784
Gerrit-PatchSet: 1
Gerrit-Owner: Vasil Velichkov 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vasil Velichkov 
Gerrit-Comment-Date: Tue, 11 Sep 2018 07:42:30 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in gr-gsm[master]: Format the output into ostringstream and then write it at once.

2018-09-11 Thread Piotr Krysik
Piotr Krysik has posted comments on this change. ( 
https://gerrit.osmocom.org/10731 )

Change subject: Format the output into ostringstream and then write it at once.
..


Patch Set 1: -Verified -Code-Review


--
To view, visit https://gerrit.osmocom.org/10731
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1012ed26371b4c67163545652f0a1ce0f576af9e
Gerrit-Change-Number: 10731
Gerrit-PatchSet: 1
Gerrit-Owner: Vasil Velichkov 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vasil Velichkov 
Gerrit-Comment-Date: Tue, 11 Sep 2018 07:43:45 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in gr-gsm[master]: Format the output into ostringstream and then write it at once.

2018-09-11 Thread Piotr Krysik
Piotr Krysik has posted comments on this change. ( 
https://gerrit.osmocom.org/10731 )

Change subject: Format the output into ostringstream and then write it at once.
..


Patch Set 1: Verified+1 Code-Review+2


--
To view, visit https://gerrit.osmocom.org/10731
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1012ed26371b4c67163545652f0a1ce0f576af9e
Gerrit-Change-Number: 10731
Gerrit-PatchSet: 1
Gerrit-Owner: Vasil Velichkov 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vasil Velichkov 
Gerrit-Comment-Date: Tue, 11 Sep 2018 07:43:52 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in gr-gsm[master]: apps/grgsm_trx: migrate from getopt to argparse

2018-09-11 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/10832 )

Change subject: apps/grgsm_trx: migrate from getopt to argparse
..


Patch Set 1:

> some of my changes were just thrown away without explanation

The explanation is simple: both are not related to argparse itself.
I prefer to have atomic changes, so if some day we will have to
revert this particular commit, we wouldn't lose the changes you
mentioned below.

So, let's keep this change as-is, because it does exactly what is
stated in the commit message. While renaming variables and changing
class definitions for sure can (and I think should) be done in
separate changes ;)


--
To view, visit https://gerrit.osmocom.org/10832
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I24a17b4cd44db0ce95a19d7470f4f09f3c85a26d
Gerrit-Change-Number: 10832
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 11 Sep 2018 07:56:15 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in gr-gsm[master]: grgsm_scanner: Add --debug option

2018-09-11 Thread Piotr Krysik
Piotr Krysik has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10784 )

Change subject: grgsm_scanner: Add --debug option
..

grgsm_scanner: Add --debug option

When set the stdout and stderr won't be redirected to /dev/null which
will facilitate resolving issues

Change-Id: I11e99facb5a1ab9c9bfee3c314a91a74f98a2523
---
M apps/grgsm_scanner
1 file changed, 21 insertions(+), 16 deletions(-)

Approvals:
  Piotr Krysik: Looks good to me, approved; Verified



diff --git a/apps/grgsm_scanner b/apps/grgsm_scanner
index b57569d..32210ed 100755
--- a/apps/grgsm_scanner
+++ b/apps/grgsm_scanner
@@ -297,7 +297,7 @@
 return "ARFCN: %4u, Freq: %6.1fM, CID: %5u, LAC: %5u, MCC: %3u, MNC: 
%3u, Pwr: %3i" % (
 self.arfcn, self.freq / 1e6, self.cid, self.lac, self.mcc, 
self.mnc, self.power)

-def do_scan(samp_rate, band, speed, ppm, gain, args, prn = None):
+def do_scan(samp_rate, band, speed, ppm, gain, args, prn = None, debug = 
False):
 signallist = []
 channels_num = int(samp_rate / 0.2e6)
 for arfcn_range in grgsm.arfcn.get_arfcn_ranges(band):
@@ -311,14 +311,15 @@

 while current_freq < stop_freq:

-# silence rtl_sdr output:
-# open 2 fds
-null_fds = [os.open(os.devnull, os.O_RDWR) for x in xrange(2)]
-# save the current file descriptors to a tuple
-save = os.dup(1), os.dup(2)
-# put /dev/null fds on 1 and 2
-os.dup2(null_fds[0], 1)
-os.dup2(null_fds[1], 2)
+if not debug:
+# silence rtl_sdr output:
+# open 2 fds
+null_fds = [os.open(os.devnull, os.O_RDWR) for x in xrange(2)]
+# save the current file descriptors to a tuple
+save = os.dup(1), os.dup(2)
+# put /dev/null fds on 1 and 2
+os.dup2(null_fds[0], 1)
+os.dup2(null_fds[1], 2)

 # instantiate scanner and processor
 scanner = wideband_scanner(rec_len=6 - speed,
@@ -359,12 +360,14 @@

 scanner = None

-# restore file descriptors so we can print the results
-os.dup2(save[0], 1)
-os.dup2(save[1], 2)
-# close the temporary fds
-os.close(null_fds[0])
-os.close(null_fds[1])
+
+if not debug:
+# restore file descriptors so we can print the results
+os.dup2(save[0], 1)
+os.dup2(save[1], 2)
+# close the temporary fds
+os.close(null_fds[0])
+os.close(null_fds[1])
 if prn:
 prn(found_list)
 signallist.extend(found_list)
@@ -389,6 +392,8 @@
   help="Scan speed [default=%default]. Value range 0-5.")
 parser.add_option("-v", "--verbose", action="store_true",
   help="If set, verbose information output is printed: 
ccch configuration, cell ARFCN's, neighbour ARFCN's")
+parser.add_option("-d", "--debug", action="store_true",
+  help="Print additional debug messages")

 """
 Dont forget: sudo sysctl kernel.shmmni=32000
@@ -415,7 +420,7 @@
 print info.get_verbose_info()
 print ""
 do_scan(options.samp_rate, options.band, options.speed,
-options.ppm, options.gain, options.args, prn = printfunc)
+options.ppm, options.gain, options.args, prn = printfunc, debug = 
options.debug)

 if __name__ == '__main__':
 main()

--
To view, visit https://gerrit.osmocom.org/10784
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I11e99facb5a1ab9c9bfee3c314a91a74f98a2523
Gerrit-Change-Number: 10784
Gerrit-PatchSet: 2
Gerrit-Owner: Vasil Velichkov 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vasil Velichkov 


Change in gr-gsm[master]: apps/grgsm_trx: migrate from getopt to argparse

2018-09-11 Thread Piotr Krysik
Piotr Krysik has posted comments on this change. ( 
https://gerrit.osmocom.org/10832 )

Change subject: apps/grgsm_trx: migrate from getopt to argparse
..


Patch Set 1: -Verified -Code-Review


--
To view, visit https://gerrit.osmocom.org/10832
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I24a17b4cd44db0ce95a19d7470f4f09f3c85a26d
Gerrit-Change-Number: 10832
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 11 Sep 2018 08:33:38 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in gr-gsm[master]: Format the output into ostringstream and then write it at once.

2018-09-11 Thread Piotr Krysik
Piotr Krysik has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10731 )

Change subject: Format the output into ostringstream and then write it at once.
..

Format the output into ostringstream and then write it at once.

This fixes the garbled output when multiple printers are used in a
flowgraph.

closes #255
closes #420

Change-Id: I1012ed26371b4c67163545652f0a1ce0f576af9e
---
M lib/misc_utils/bursts_printer_impl.cc
M lib/misc_utils/message_printer_impl.cc
2 files changed, 21 insertions(+), 16 deletions(-)

Approvals:
  Piotr Krysik: Looks good to me, approved; Verified



diff --git a/lib/misc_utils/bursts_printer_impl.cc 
b/lib/misc_utils/bursts_printer_impl.cc
index c22e60b..ab9c319 100644
--- a/lib/misc_utils/bursts_printer_impl.cc
+++ b/lib/misc_utils/bursts_printer_impl.cc
@@ -66,48 +66,50 @@
 return;
 }

-std::cout << d_prepend_string;
+std::ostringstream out;
+out << d_prepend_string;
 if (d_prepend_fnr)
 {
-std::cout << frame_nr;
+out << frame_nr;
 }

 if (d_prepend_fnr && d_prepend_frame_count)
 {
-std::cout << " ";
+out << " ";
 }

 if (d_prepend_frame_count)
 {
 // calculate fn count using libosmogsm
-std::cout << osmo_a5_fn_count(frame_nr);
+out << osmo_a5_fn_count(frame_nr);
 }

 if (d_prepend_fnr || d_prepend_frame_count)
 {
-std::cout << ": ";
+out << ": ";
 }

 if (d_print_payload_only)
 {
 for (int ii=0; ii<57; ii++)
 {
-std::cout << std::setprecision(1) << static_cast(burst[ii 
+ 3]);
+out << std::setprecision(1) << static_cast(burst[ii + 3]);
 }
 for (int ii=0; ii<57; ii++)
 {
-std::cout << std::setprecision(1) << static_cast(burst[ii 
+ 88]);
+out << std::setprecision(1) << static_cast(burst[ii + 
88]);
 }
 }
 else
 {
 for(int ii=0; ii(burst[ii]);
+  out << std::setprecision(1) << static_cast(burst[ii]);
 }
 }

-std::cout << std::endl;
+out << std::endl;
+std::cout << out.str() << std::flush;
 }

 bool bursts_printer_impl::is_dummy_burst(int8_t *burst, size_t burst_len)
diff --git a/lib/misc_utils/message_printer_impl.cc 
b/lib/misc_utils/message_printer_impl.cc
index e8aa2d3..8342946 100644
--- a/lib/misc_utils/message_printer_impl.cc
+++ b/lib/misc_utils/message_printer_impl.cc
@@ -46,26 +46,27 @@
 gsmtap_hdr * header = (gsmtap_hdr *)message_plus_header;
 uint32_t frame_nr = be32toh(header->frame_number);

-std::cout << d_prepend_string;
+std::ostringstream out;
+out << d_prepend_string;
 if (d_prepend_fnr)
 {
-std::cout << frame_nr;
+out << frame_nr;
 }

 if (d_prepend_fnr && d_prepend_frame_count)
 {
-std::cout << " ";
+out << " ";
 }

 if (d_prepend_frame_count)
 {
 // calculate fn count using libosmogsm
-std::cout << osmo_a5_fn_count(frame_nr);
+out << osmo_a5_fn_count(frame_nr);
 }

 if (d_prepend_fnr || d_prepend_frame_count)
 {
-std::cout << ": ";
+out << ": ";
 }

 int start_index = sizeof(gsmtap_hdr);
@@ -77,9 +78,11 @@

 for(int ii=start_index; iihttps://gerrit.osmocom.org/10731
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1012ed26371b4c67163545652f0a1ce0f576af9e
Gerrit-Change-Number: 10731
Gerrit-PatchSet: 2
Gerrit-Owner: Vasil Velichkov 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vasil Velichkov 


Change in docker-playground[master]: debian-repo-install-test: new binary package test

2018-09-11 Thread osmith
Hello Neels Hofmeyr, Harald Welte,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/10862

to look at the new patch set (#3).

Change subject: debian-repo-install-test: new binary package test
..

debian-repo-install-test: new binary package test

Installs all packages from the Debian repository into a plain
debian:stretch container. The list of packages is automatically
generated with aptitude, so the job does not need to be changed
for every new package.

The feed ("latest", "nightly") can be specified with the FEED
environment variable in the jenkins.sh (defaults to nightly).

Change-Id: I0f0a8b4f0ccd706cd1af98fe25accd6fd410e007
Relates: OS#3176
---
A debian-repo-install-test/jenkins.sh
A debian-repo-install-test/testdata/Release.key
A debian-repo-install-test/testdata/repo-install-test.sh
3 files changed, 94 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/docker-playground 
refs/changes/62/10862/3
--
To view, visit https://gerrit.osmocom.org/10862
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0f0a8b4f0ccd706cd1af98fe25accd6fd410e007
Gerrit-Change-Number: 10862
Gerrit-PatchSet: 3
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 


Change in gr-gsm[master]: apps/grgsm_trx: fix inaccurate sample rate calculation

2018-09-11 Thread Piotr Krysik
Piotr Krysik has posted comments on this change. ( 
https://gerrit.osmocom.org/10831 )

Change subject: apps/grgsm_trx: fix inaccurate sample rate calculation
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/10831
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0c309588fa0f7822abfb3919327639735db07679
Gerrit-Change-Number: 10831
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 11 Sep 2018 09:39:15 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in gr-gsm[master]: apps/grgsm_trx: fix inaccurate sample rate calculation

2018-09-11 Thread Piotr Krysik
Piotr Krysik has abandoned this change. ( https://gerrit.osmocom.org/10831 )

Change subject: apps/grgsm_trx: fix inaccurate sample rate calculation
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/10831
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: I0c309588fa0f7822abfb3919327639735db07679
Gerrit-Change-Number: 10831
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in gr-gsm[master]: apps/grgsm_trx: fix inaccurate sample rate calculation

2018-09-11 Thread Piotr Krysik
Piotr Krysik has restored this change. ( https://gerrit.osmocom.org/10831 )

Change subject: apps/grgsm_trx: fix inaccurate sample rate calculation
..


Restored
--
To view, visit https://gerrit.osmocom.org/10831
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: restore
Gerrit-Change-Id: I0c309588fa0f7822abfb3919327639735db07679
Gerrit-Change-Number: 10831
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-bts[master]: fix RSL Chan Mode Modif for dyn TS

2018-09-11 Thread Keith Whyte
Keith Whyte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10864 )

Change subject: fix RSL Chan Mode Modif for dyn TS
..

fix RSL Chan Mode Modif for dyn TS

Fix the chan mode checking for RSL Chan Mode Modif: do not reject
all modes on dyn TS.

In rsl_rx_mode_modif(), bts_supports_cm() should never
be fed with dynamic pchan kinds (e.g. GSM_PCHAN_TCH_F_TCH_H_PDCH).
Feed instead the return value of ts_pchan() that is to say,
the actual pchan type (e.g. GSM_PCHAN_TCH_F).

Change-Id: I7f0c835b25289931bccf96e982ea5564c8be4192
---
M src/common/rsl.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/common/rsl.c b/src/common/rsl.c
index c6c00ea..ad2d4de 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1498,7 +1498,7 @@
cm = (struct rsl_ie_chan_mode *) TLVP_VAL(&tp, RSL_IE_CHAN_MODE);
lchan_tchmode_from_cmode(lchan, cm);

-   if (bts_supports_cm(lchan->ts->trx->bts, lchan->ts->pchan, 
lchan->tch_mode) != 1) {
+   if (bts_supports_cm(lchan->ts->trx->bts, ts_pchan(lchan->ts), 
lchan->tch_mode) != 1) {
LOGP(DRSL, LOGL_ERROR, "invalid mode/codec instructed by BSC, 
check BSC configuration.\n");
return rsl_tx_mode_modif_nack(lchan, RSL_ERR_SERV_OPT_UNAVAIL);
}

--
To view, visit https://gerrit.osmocom.org/10864
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7f0c835b25289931bccf96e982ea5564c8be4192
Gerrit-Change-Number: 10864
Gerrit-PatchSet: 5
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Keith Whyte 
Gerrit-Reviewer: Neels Hofmeyr 


Change in osmo-bts[master]: log: add error log for RSL Chan Mode Modif

2018-09-11 Thread Keith Whyte
Keith Whyte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10869 )

Change subject: log: add error log for RSL Chan Mode Modif
..

log: add error log for RSL Chan Mode Modif

Add log context to chan_mode error in rsl_rx_mode_modif().

Tweaked-by: neels
Change-Id: I945cf1ca8660ad5daf097edab1833bbc74b6185f
---
M src/common/rsl.c
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/common/rsl.c b/src/common/rsl.c
index ad2d4de..2aa7f4d 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1499,7 +1499,10 @@
lchan_tchmode_from_cmode(lchan, cm);

if (bts_supports_cm(lchan->ts->trx->bts, ts_pchan(lchan->ts), 
lchan->tch_mode) != 1) {
-   LOGP(DRSL, LOGL_ERROR, "invalid mode/codec instructed by BSC, 
check BSC configuration.\n");
+   LOGP(DRSL, LOGL_ERROR,
+"%s %s: invalid mode: %s (wrong BSC configuration?)\n",
+gsm_ts_and_pchan_name(lchan->ts), gsm_lchan_name(lchan),
+gsm48_chan_mode_name(lchan->tch_mode));
return rsl_tx_mode_modif_nack(lchan, RSL_ERR_SERV_OPT_UNAVAIL);
}


--
To view, visit https://gerrit.osmocom.org/10869
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I945cf1ca8660ad5daf097edab1833bbc74b6185f
Gerrit-Change-Number: 10869
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Keith Whyte 


Change in osmo-bts[master]: fix handling of odd pchans in bts_supports_cm()

2018-09-11 Thread Keith Whyte
Keith Whyte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10870 )

Change subject: fix handling of odd pchans in bts_supports_cm()
..

fix handling of odd pchans in bts_supports_cm()

Convert the if-cascade to a switch().

For any unexpected pchan kind, reject the chan mode immediately instead of
going on to invoke gsm_bts_has_feature on feature = _NUM_BTS_FEAT, and log the
error.

Tweaked-by: neels
Change-Id: Ieaded9258554b15fcc4b7f05d5a8847175b7962f
---
M src/common/bts.c
1 file changed, 11 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/common/bts.c b/src/common/bts.c
index bec611c..c251fdd 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -704,7 +704,8 @@

/* Before the requested pchan/cm combination can be checked, we need to
 * convert it to a feature identifier we can check */
-   if (pchan == GSM_PCHAN_TCH_F) {
+   switch (pchan) {
+   case GSM_PCHAN_TCH_F:
switch(cm) {
case GSM48_CMODE_SPEECH_V1:
feature = BTS_FEAT_SPEECH_F_V1;
@@ -719,7 +720,9 @@
/* Invalid speech codec type => Not supported! */
return 0;
}
-   } else if (pchan == GSM_PCHAN_TCH_H) {
+   break;
+
+   case GSM_PCHAN_TCH_H:
switch(cm) {
case GSM48_CMODE_SPEECH_V1:
feature = BTS_FEAT_SPEECH_H_V1;
@@ -731,6 +734,12 @@
/* Invalid speech codec type => Not supported! */
return 0;
}
+   break;
+
+   default:
+   LOGP(DRSL, LOGL_ERROR, "BTS %u: unhandled pchan %s when 
checking mode %s\n",
+bts->nr, gsm_pchan_name(pchan), gsm48_chan_mode_name(cm));
+   return 0;
}

/* Check if the feature is supported by this BTS */

--
To view, visit https://gerrit.osmocom.org/10870
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieaded9258554b15fcc4b7f05d5a8847175b7962f
Gerrit-Change-Number: 10870
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Keith Whyte 


Build failed in Jenkins: master-asn1c » a1=default,a2=default,a3=default,osmocom-master-debian9 #243

2018-09-11 Thread jenkins
See 


--
[...truncated 3.67 KB...]

+ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for autoconf... /usr/bin/autoconf
checking for autoheader... /usr/bin/autoheader
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dep

Change in osmo-ttcn3-hacks[master]: L3_Common: extend the AuthVector to contain AUTS

2018-09-11 Thread lynxis lazus
Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/10767

to look at the new patch set (#5).

Change subject: L3_Common: extend the AuthVector to contain AUTS
..

L3_Common: extend the AuthVector to contain AUTS

AUTS is used in the UMTS AKA resync procedure.

Change-Id: Id1afa47778e6220cab375ae4b54b251801724fdb
---
M library/L3_Common.ttcn
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/67/10767/5
--
To view, visit https://gerrit.osmocom.org/10767
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id1afa47778e6220cab375ae4b54b251801724fdb
Gerrit-Change-Number: 10767
Gerrit-PatchSet: 5
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-sgsn[master]: gprs_gmm: introduce a GMM Attach Request FSM

2018-09-11 Thread lynxis lazus
lynxis lazus has posted comments on this change. ( 
https://gerrit.osmocom.org/9257 )

Change subject: gprs_gmm: introduce a GMM Attach Request FSM
..


Patch Set 15:

(1 comment)

https://gerrit.osmocom.org/#/c/9257/15/include/osmocom/sgsn/gprs_gmm_attach.h
File include/osmocom/sgsn/gprs_gmm_attach.h:

https://gerrit.osmocom.org/#/c/9257/15/include/osmocom/sgsn/gprs_gmm_attach.h@8
PS15, Line 8: enum gmm_attach_req_fsm_states {
> if those states are modelled after any spec reference, it might be useful to 
> document it here in a c […]
I'ven't found FSM in the spec for the attach request.



--
To view, visit https://gerrit.osmocom.org/9257
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I58b9c17be9776a03bb2a5b21e99135cfefc8c912
Gerrit-Change-Number: 9257
Gerrit-PatchSet: 15
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: lynxis lazus 
Gerrit-Comment-Date: Tue, 11 Sep 2018 16:31:49 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in gr-gsm[master]: trx/radio_if.py: clarify magic numbers in sample rate calculation

2018-09-11 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/10880


Change subject: trx/radio_if.py: clarify magic numbers in sample rate 
calculation
..

trx/radio_if.py: clarify magic numbers in sample rate calculation

Change-Id: I55f283113d0324a0236b7bbf13bce5718003b857
---
M python/trx/radio_if.py
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/80/10880/1

diff --git a/python/trx/radio_if.py b/python/trx/radio_if.py
index 2aeb49a..f7f124f 100644
--- a/python/trx/radio_if.py
+++ b/python/trx/radio_if.py
@@ -75,8 +75,8 @@
GSM_TS_PERIOD_uS = GSM_SYM_PERIOD_uS * 156.25
GSM_UL_DL_SHIFT_uS = -(GSM_TS_PERIOD_uS * 3)

-   # TODO: explain where do these values come from?
-   SAMPLE_RATE = 4.0 * 1625000.0 / 6.0
+   GSM_SYM_RATE = (1.0 / GSM_SYM_PERIOD_uS) * 1e6
+   SAMPLE_RATE = GSM_SYM_RATE * osr

# FIXME: shall be measured (automatically?) for
# particular device and particular clock rate.

--
To view, visit https://gerrit.osmocom.org/10880
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I55f283113d0324a0236b7bbf13bce5718003b857
Gerrit-Change-Number: 10880
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Change in gr-gsm[master]: apps/grgsm_trx: migrate from getopt to argparse

2018-09-11 Thread Vadim Yanitskiy
Hello Piotr Krysik,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/10832

to look at the new patch set (#3).

Change subject: apps/grgsm_trx: migrate from getopt to argparse
..

apps/grgsm_trx: migrate from getopt to argparse

Change-Id: I24a17b4cd44db0ce95a19d7470f4f09f3c85a26d
---
M apps/grgsm_trx
1 file changed, 69 insertions(+), 106 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/32/10832/3
--
To view, visit https://gerrit.osmocom.org/10832
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I24a17b4cd44db0ce95a19d7470f4f09f3c85a26d
Gerrit-Change-Number: 10832
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in gr-gsm[master]: trx/radio_if.py: clarify magic numbers in sample rate calculation

2018-09-11 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded a new patch set (#2). ( 
https://gerrit.osmocom.org/10880 )

Change subject: trx/radio_if.py: clarify magic numbers in sample rate 
calculation
..

trx/radio_if.py: clarify magic numbers in sample rate calculation

Change-Id: I55f283113d0324a0236b7bbf13bce5718003b857
---
M python/trx/radio_if.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/80/10880/2
-- 
To view, visit https://gerrit.osmocom.org/10880
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I55f283113d0324a0236b7bbf13bce5718003b857
Gerrit-Change-Number: 10880
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Piotr Krysik 


Change in gr-gsm[master]: burst_file_source: Fix reading longer bursts

2018-09-11 Thread Vasil Velichkov
Vasil Velichkov has uploaded this change for review. ( 
https://gerrit.osmocom.org/10881


Change subject: burst_file_source: Fix reading longer bursts
..

burst_file_source: Fix reading longer bursts

- Read bursts with pmt::deserialize directly from the std::filebuf
- Remove the unused unserialized variable
- Add tests

Since df978693 when the rx_time tags are present in the incomming stream
the gsm receiver adds fm_time to the burst's PMT and the bursts that
burst file sink writes becomes longer because of the additional field.

The burst file source block was expecting all burst to be 147 bytes long
and reading files with longer bursts was failing with an unhandled exception.

terminate called after throwing an instance of 'pmt::exception'
thread[thread-per-block[5]: ]: pmt_cdr: 
wrong_type : #f
  what():  pmt::deserialize: malformed input stream, tag value = : 115

Change-Id: I989b0d6a6b214088b7880e5cbf7bb6725492dbfc
---
M lib/misc_utils/burst_file_source_impl.cc
M lib/qa_utils/burst_source_impl.cc
M python/CMakeLists.txt
A python/qa_burst_file_source.py
4 files changed, 110 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/81/10881/1

diff --git a/lib/misc_utils/burst_file_source_impl.cc 
b/lib/misc_utils/burst_file_source_impl.cc
index 4367150..64332c4 100644
--- a/lib/misc_utils/burst_file_source_impl.cc
+++ b/lib/misc_utils/burst_file_source_impl.cc
@@ -28,8 +28,6 @@
 #include "burst_file_source_impl.h"
 #include "stdio.h"

-#define PMT_SIZE 174
-
 namespace gr {
   namespace gsm {

@@ -86,18 +84,16 @@

 void burst_file_source_impl::run()
 {
-char *unserialized = (char*)malloc(sizeof(char) * PMT_SIZE);
-while (d_input_file.read(unserialized, PMT_SIZE) && !d_finished)
+std::filebuf* pbuf = d_input_file.rdbuf();
+while (!d_finished)
 {
-if (d_input_file.bad())
-{
+pmt::pmt_t burst = pmt::deserialize(*pbuf);
+if (pmt::is_eof_object(burst)) {
 break;
 }
-
-std::string s(unserialized, PMT_SIZE);
-pmt::pmt_t burst = pmt::deserialize_str(s);
 message_port_pub(pmt::mp("out"), burst);
 }
+
 d_input_file.close();
 post(pmt::mp("system"), pmt::cons(pmt::mp("done"), pmt::from_long(1)));
 }
diff --git a/lib/qa_utils/burst_source_impl.cc 
b/lib/qa_utils/burst_source_impl.cc
index db3d85a..f415eaf 100644
--- a/lib/qa_utils/burst_source_impl.cc
+++ b/lib/qa_utils/burst_source_impl.cc
@@ -31,8 +31,6 @@
 #include 
 #include 

-#define PMT_SIZE 174
-
 namespace gr {
   namespace gsm {

@@ -110,8 +108,6 @@

 void burst_source_impl::run()
 {
-char *unserialized = (char*)malloc(sizeof(char) * PMT_SIZE);
-
 for (int i=0; i
+# @section LICENSE
+#
+# Gr-gsm is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# Gr-gsm is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with gr-gsm; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+#
+
+from gnuradio import gr, gr_unittest, blocks
+import grgsm_swig as grgsm
+import tempfile
+
+class qa_burst_file_sink (gr_unittest.TestCase):
+
+def setUp (self):
+self.tb = gr.top_block ()
+
+def tearDown (self):
+self.tb = None
+
+def test_blob_only (self):
+# prepare the input burst file
+temp = tempfile.NamedTemporaryFile()
+handle = open(temp.name, "wb")
+handle.write(bytearray([
+0x07, 0x06, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x02, 
0x04, 0x03, 0x01, 0x00, 0x6f,
+0xcd, 0x00, 0x00, 0x25, 0xc9, 0x82, 0x06, 0x1c, 0xf5, 0x38, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 
0x01, 0x00, 0x01, 0x01, 0x01,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 
0x01, 0x01, 0x01, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 
0x01, 0x01, 0x00, 0x01, 0x01,
+0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 
0x01, 0x01, 0x00, 0x01, 0x01,
+0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00,

Change in gr-gsm[master]: apps/grgsm_trx: fix inaccurate sample rate calculation

2018-09-11 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/10831 )

Change subject: apps/grgsm_trx: fix inaccurate sample rate calculation
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/10831
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0c309588fa0f7822abfb3919327639735db07679
Gerrit-Change-Number: 10831
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Piotr Krysik 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 11 Sep 2018 19:46:15 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: ts, lchan_fsm: do not attempt to allocate CBCH subslots

2018-09-11 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10871 )

Change subject: ts,lchan_fsm: do not attempt to allocate CBCH subslots
..


Patch Set 2:

(1 comment)

Patch set 2 already shows type=CBCH, just the comment for it was forgotten and 
only came through with the reply after that.

Anything else that should be resolved?

https://gerrit.osmocom.org/#/c/10871/1//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/10871/1//COMMIT_MSG@22
PS1, Line 22:   BTS 0, TRX 0, Timeslot 1 SDCCH8+CBCH, Lchan 2, Type CBCH, State 
CBCH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm
> maybe the type should also show as CBCH instead of NONE? How does it work, 
> does the CBCH need Chan A […]
Done



--
To view, visit https://gerrit.osmocom.org/10871
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2bafc5f696e818e38f8907ad0c8f38494df0623d
Gerrit-Change-Number: 10871
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Tue, 11 Sep 2018 19:48:28 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Build failure of network:osmocom:nightly/simtrace2 in Debian_9.0/x86_64

2018-09-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/Debian_9.0/x86_64

Package network:osmocom:nightly/simtrace2 failed to build in Debian_9.0/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly simtrace2

Last lines of build log:
[  113s] No package 'libpcsclite' found
[  113s] simtrace2-remsim.o: In function `main':
[  113s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:664: undefined 
reference to `osim_uicc_sim_cic_profile'
[  113s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:689: undefined 
reference to `osim_reader_open'
[  113s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:695: undefined 
reference to `osim_card_open'
[  113s] apdu_dispatch.o: In function `apdu_segment_in':
[  113s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_uicc_sim_cic_profile'
[  113s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_determine_apdu_case'
[  113s] collect2: error: ld returned 1 exit status
[  113s] Makefile:9: recipe for target 'simtrace2-remsim' failed
[  113s] make[2]: *** [simtrace2-remsim] Error 1
[  113s] make[2]: Leaving directory '/usr/src/packages/BUILD/host'
[  113s] Makefile:20: recipe for target 'utils' failed
[  113s] make[1]: *** [utils] Error 2
[  113s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  113s] dh_auto_build: make -j1 returned exit code 2
[  113s] debian/rules:4: recipe for target 'build' failed
[  113s] make: *** [build] Error 2
[  113s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  113s] 
[  113s] sheep82 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:08:59 UTC 2018.
[  113s] 
[  113s] ### VM INTERACTION START ###
[  116s] [  108.093411] sysrq: SysRq : Power Off
[  116s] [  108.098758] reboot: Power down
[  117s] ### VM INTERACTION END ###
[  117s] 
[  117s] sheep82 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:09:03 UTC 2018.
[  117s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/simtrace2 in xUbuntu_16.04/x86_64

2018-09-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/xUbuntu_16.04/x86_64

Package network:osmocom:nightly/simtrace2 failed to build in 
xUbuntu_16.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly simtrace2

Last lines of build log:
[  115s] No package 'libpcsclite' found
[  115s] simtrace2-remsim.o: In function `main':
[  115s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:664: undefined 
reference to `osim_uicc_sim_cic_profile'
[  115s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:689: undefined 
reference to `osim_reader_open'
[  115s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:695: undefined 
reference to `osim_card_open'
[  115s] apdu_dispatch.o: In function `apdu_segment_in':
[  115s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_uicc_sim_cic_profile'
[  115s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_determine_apdu_case'
[  115s] collect2: error: ld returned 1 exit status
[  115s] Makefile:9: recipe for target 'simtrace2-remsim' failed
[  115s] make[2]: *** [simtrace2-remsim] Error 1
[  115s] make[2]: Leaving directory '/usr/src/packages/BUILD/host'
[  115s] Makefile:20: recipe for target 'utils' failed
[  115s] make[1]: *** [utils] Error 2
[  115s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  115s] dh_auto_build: make -j1 returned exit code 2
[  115s] debian/rules:4: recipe for target 'build' failed
[  115s] make: *** [build] Error 2
[  115s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  115s] 
[  115s] sheep81 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:12:48 UTC 2018.
[  115s] 
[  115s] ### VM INTERACTION START ###
[  119s] [  112.107089] sysrq: SysRq : Power Off
[  119s] [  112.121239] reboot: Power down
[  119s] ### VM INTERACTION END ###
[  119s] 
[  119s] sheep81 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:12:52 UTC 2018.
[  119s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Change in libosmocore[master]: tests: fix LDADD: link libosmovty from current build

2018-09-11 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/5844 )

Change subject: tests: fix LDADD: link libosmovty from current build
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/5844
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6
Gerrit-Change-Number: 5844
Gerrit-PatchSet: 4
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 11 Sep 2018 20:23:33 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Build failure of network:osmocom:nightly/simtrace2 in Debian_9.0/i586

2018-09-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/Debian_9.0/i586

Package network:osmocom:nightly/simtrace2 failed to build in Debian_9.0/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly simtrace2

Last lines of build log:
[  143s] No package 'libpcsclite' found
[  143s] simtrace2-remsim.o: In function `main':
[  143s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:664: undefined 
reference to `osim_uicc_sim_cic_profile'
[  143s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:689: undefined 
reference to `osim_reader_open'
[  143s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:695: undefined 
reference to `osim_card_open'
[  143s] apdu_dispatch.o: In function `apdu_segment_in':
[  143s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_uicc_sim_cic_profile'
[  143s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_determine_apdu_case'
[  143s] collect2: error: ld returned 1 exit status
[  143s] Makefile:9: recipe for target 'simtrace2-remsim' failed
[  143s] make[2]: *** [simtrace2-remsim] Error 1
[  143s] make[2]: Leaving directory '/usr/src/packages/BUILD/host'
[  143s] Makefile:20: recipe for target 'utils' failed
[  143s] make[1]: *** [utils] Error 2
[  143s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  143s] dh_auto_build: make -j1 returned exit code 2
[  143s] debian/rules:4: recipe for target 'build' failed
[  143s] make: *** [build] Error 2
[  143s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  143s] 
[  143s] lamb02 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:30:44 UTC 2018.
[  143s] 
[  143s] ### VM INTERACTION START ###
[  147s] [  134.053987] sysrq: SysRq : Power Off
[  147s] [  134.059660] reboot: Power down
[  147s] ### VM INTERACTION END ###
[  147s] 
[  147s] lamb02 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:30:48 UTC 2018.
[  147s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/simtrace2 in xUbuntu_17.10/x86_64

2018-09-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/xUbuntu_17.10/x86_64

Package network:osmocom:nightly/simtrace2 failed to build in 
xUbuntu_17.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly simtrace2

Last lines of build log:
[  261s] No package 'libpcsclite' found
[  261s] simtrace2-remsim.o: In function `main':
[  261s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:664: undefined 
reference to `osim_uicc_sim_cic_profile'
[  261s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:689: undefined 
reference to `osim_reader_open'
[  261s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:695: undefined 
reference to `osim_card_open'
[  261s] apdu_dispatch.o: In function `apdu_segment_in':
[  261s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_uicc_sim_cic_profile'
[  261s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_determine_apdu_case'
[  261s] collect2: error: ld returned 1 exit status
[  261s] Makefile:9: recipe for target 'simtrace2-remsim' failed
[  261s] make[2]: *** [simtrace2-remsim] Error 1
[  261s] make[2]: Leaving directory '/usr/src/packages/BUILD/host'
[  261s] Makefile:20: recipe for target 'utils' failed
[  261s] make[1]: *** [utils] Error 2
[  261s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  261s] dh_auto_build: make -j1 returned exit code 2
[  261s] debian/rules:4: recipe for target 'build' failed
[  261s] make: *** [build] Error 2
[  261s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  261s] 
[  261s] lamb07 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:32:11 UTC 2018.
[  261s] 
[  261s] ### VM INTERACTION START ###
[  264s] [  221.416748] sysrq: SysRq : Power Off
[  264s] [  221.425530] reboot: Power down
[  264s] ### VM INTERACTION END ###
[  264s] 
[  264s] lamb07 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:32:14 UTC 2018.
[  264s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/simtrace2 in xUbuntu_17.10/i586

2018-09-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/xUbuntu_17.10/i586

Package network:osmocom:nightly/simtrace2 failed to build in xUbuntu_17.10/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly simtrace2

Last lines of build log:
[  150s] No package 'libpcsclite' found
[  150s] simtrace2-remsim.o: In function `main':
[  150s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:664: undefined 
reference to `osim_uicc_sim_cic_profile'
[  150s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:689: undefined 
reference to `osim_reader_open'
[  150s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:695: undefined 
reference to `osim_card_open'
[  150s] apdu_dispatch.o: In function `apdu_segment_in':
[  150s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_uicc_sim_cic_profile'
[  150s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_determine_apdu_case'
[  150s] collect2: error: ld returned 1 exit status
[  150s] Makefile:9: recipe for target 'simtrace2-remsim' failed
[  150s] make[2]: *** [simtrace2-remsim] Error 1
[  150s] make[2]: Leaving directory '/usr/src/packages/BUILD/host'
[  150s] Makefile:20: recipe for target 'utils' failed
[  150s] make[1]: *** [utils] Error 2
[  150s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  150s] dh_auto_build: make -j1 returned exit code 2
[  150s] debian/rules:4: recipe for target 'build' failed
[  150s] make: *** [build] Error 2
[  150s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  150s] 
[  150s] build80 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:33:18 UTC 2018.
[  150s] 
[  150s] ### VM INTERACTION START ###
[  153s] [  142.395224] sysrq: SysRq : Power Off
[  153s] [  142.565872] reboot: Power down
[  153s] ### VM INTERACTION END ###
[  153s] 
[  153s] build80 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:33:22 UTC 2018.
[  153s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/simtrace2 in xUbuntu_16.04/i586

2018-09-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/xUbuntu_16.04/i586

Package network:osmocom:nightly/simtrace2 failed to build in xUbuntu_16.04/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly simtrace2

Last lines of build log:
[  132s] No package 'libpcsclite' found
[  132s] simtrace2-remsim.o: In function `main':
[  132s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:664: undefined 
reference to `osim_uicc_sim_cic_profile'
[  132s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:689: undefined 
reference to `osim_reader_open'
[  132s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:695: undefined 
reference to `osim_card_open'
[  132s] apdu_dispatch.o: In function `apdu_segment_in':
[  132s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_uicc_sim_cic_profile'
[  132s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_determine_apdu_case'
[  132s] collect2: error: ld returned 1 exit status
[  132s] Makefile:9: recipe for target 'simtrace2-remsim' failed
[  132s] make[2]: *** [simtrace2-remsim] Error 1
[  132s] make[2]: Leaving directory '/usr/src/packages/BUILD/host'
[  132s] Makefile:20: recipe for target 'utils' failed
[  132s] make[1]: *** [utils] Error 2
[  132s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  132s] dh_auto_build: make -j1 returned exit code 2
[  132s] debian/rules:4: recipe for target 'build' failed
[  132s] make: *** [build] Error 2
[  132s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  132s] 
[  132s] build78 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:33:24 UTC 2018.
[  132s] 
[  132s] ### VM INTERACTION START ###
[  136s] [  125.367987] sysrq: SysRq : Power Off
[  136s] [  125.482507] reboot: Power down
[  136s] ### VM INTERACTION END ###
[  136s] 
[  136s] build78 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:33:28 UTC 2018.
[  136s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/simtrace2 in xUbuntu_18.04/i586

2018-09-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/xUbuntu_18.04/i586

Package network:osmocom:nightly/simtrace2 failed to build in xUbuntu_18.04/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly simtrace2

Last lines of build log:
[  258s] No package 'libpcsclite' found
[  258s] simtrace2-remsim.o: In function `main':
[  258s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:664: undefined 
reference to `osim_uicc_sim_cic_profile'
[  258s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:689: undefined 
reference to `osim_reader_open'
[  258s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:695: undefined 
reference to `osim_card_open'
[  258s] apdu_dispatch.o: In function `apdu_segment_in':
[  258s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_uicc_sim_cic_profile'
[  258s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_determine_apdu_case'
[  258s] collect2: error: ld returned 1 exit status
[  258s] Makefile:9: recipe for target 'simtrace2-remsim' failed
[  258s] make[2]: *** [simtrace2-remsim] Error 1
[  258s] make[2]: Leaving directory '/usr/src/packages/BUILD/host'
[  258s] Makefile:20: recipe for target 'utils' failed
[  258s] make[1]: *** [utils] Error 2
[  258s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  258s] dh_auto_build: make -j1 returned exit code 2
[  258s] debian/rules:4: recipe for target 'build' failed
[  258s] make: *** [build] Error 2
[  258s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  258s] 
[  258s] lamb06 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:36:55 UTC 2018.
[  258s] 
[  258s] ### VM INTERACTION START ###
[  262s] [  249.329314] sysrq: SysRq : Power Off
[  262s] [  249.335150] reboot: Power down
[  262s] ### VM INTERACTION END ###
[  262s] 
[  262s] lamb06 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:36:59 UTC 2018.
[  262s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/simtrace2 in xUbuntu_18.04/x86_64

2018-09-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/xUbuntu_18.04/x86_64

Package network:osmocom:nightly/simtrace2 failed to build in 
xUbuntu_18.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly simtrace2

Last lines of build log:
[  229s] No package 'libpcsclite' found
[  229s] simtrace2-remsim.o: In function `main':
[  229s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:664: undefined 
reference to `osim_uicc_sim_cic_profile'
[  229s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:689: undefined 
reference to `osim_reader_open'
[  229s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:695: undefined 
reference to `osim_card_open'
[  229s] apdu_dispatch.o: In function `apdu_segment_in':
[  229s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_uicc_sim_cic_profile'
[  229s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_determine_apdu_case'
[  229s] collect2: error: ld returned 1 exit status
[  229s] Makefile:9: recipe for target 'simtrace2-remsim' failed
[  229s] make[2]: *** [simtrace2-remsim] Error 1
[  229s] make[2]: Leaving directory '/usr/src/packages/BUILD/host'
[  229s] Makefile:20: recipe for target 'utils' failed
[  229s] make[1]: *** [utils] Error 2
[  229s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  229s] dh_auto_build: make -j1 returned exit code 2
[  229s] debian/rules:4: recipe for target 'build' failed
[  229s] make: *** [build] Error 2
[  229s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  229s] 
[  229s] cloud130 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:36:38 UTC 2018.
[  229s] 
[  229s] ### VM INTERACTION START ###
[  232s] [  201.537241] sysrq: SysRq : Power Off
[  232s] [  201.548918] reboot: Power down
[  234s] ### VM INTERACTION END ###
[  234s] 
[  234s] cloud130 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:36:44 UTC 2018.
[  234s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Change in libosmocore[master]: tests: fix LDADD: link libosmovty from current build

2018-09-11 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/5844 )

Change subject: tests: fix LDADD: link libosmovty from current build
..


Patch Set 4:

> $ make check V=s 2>&1 | grep libosmovty
 >
 > I see the following lines only:
 >
 > /bin/bash ../libtool  --tag=CC   --mode=link gcc -Wall  -g -O2
 > -DBUILDING_LIBOSMOCORE -Wall   -o vty/vty_test vty/vty_test.o
 > ../src/libosmocore.la -ltalloc   ../src/vty/libosmovty.la

Exactly, only vty_test so far linked libosmovty directly from the build tree.
The others apparently implicitly link it from where ever they can find it,
in my case from /usr/local/lib?

In an effort to understand wth is going on with linking, I reproduced this 
issue now:

Build and install libosmocore from the tip of branch neels/logging.
This makes logging_vty.c use loglevel_strs[], assert_loginfo(), tall_log_ctx 
from logging.c,
and adds loglevel_descriptions[] to logging.c and calls that from 
logging_vty.c, too.
So that means now logging_vty.c depends on these symbols to be public in 
libosmocore.a, where they were static before. With this state of linking 
installed, everything works fine.

Now go back to libosmocore master, where these symbols are still static.
Mind you, /usr/local/lib already has a libosmovty.a that depends on these 
symbols to be public in libosmocore.

When I try to build now, I get

  CCLD ctrl/ctrl_test
  /usr/bin/ld: /usr/local/lib/libosmovty.so.4: undefined reference to 
`loglevel_strs'
  /usr/bin/ld: /usr/local/lib/libosmovty.so.4: undefined reference to 
`assert_loginfo'
  /usr/bin/ld: /usr/local/lib/libosmovty.so.4: undefined reference to 
`log_level_description'
  /usr/bin/ld: /usr/local/lib/libosmovty.so.4: undefined reference to 
`tall_log_ctx'
  collect2: error: ld returned 1 exit status

Let's see

  /bin/bash ../libtool  --tag=CC   --mode=link gcc -Wall  -g -O2 
-fsanitize=address -fsanitize=undefined -Werror -Wno-error=deprecated 
-Wno-error=deprecated-declarations -Wno-error=cpp -DBUILDING_LIBOSMOCORE -Wall  
 -o ctrl/ctrl_test ctrl/ctrl_test.o ../src/libosmocore.la -ltalloc  
../src/ctrl/libosmoctrl.la
  libtool: link: gcc -Wall -g -O2 -fsanitize=address -fsanitize=undefined 
-Werror -Wno-error=deprecated -Wno-error=deprecated-declarations -Wno-error=cpp 
-DBUILDING_LIBOSMOCORE -Wall -o ctrl/.libs/ctrl_test ctrl/ctrl_test.o  
../src/.libs/libosmocore.so -ltalloc ../src/ctrl/.libs/libosmoctrl.so
  /usr/bin/ld: /usr/local/lib/libosmovty.so.4: undefined reference to 
`loglevel_strs'
  /usr/bin/ld: /usr/local/lib/libosmovty.so.4: undefined reference to 
`assert_loginfo'
  /usr/bin/ld: /usr/local/lib/libosmovty.so.4: undefined reference to 
`log_level_description'
  /usr/bin/ld: /usr/local/lib/libosmovty.so.4: undefined reference to 
`tall_log_ctx'
  collect2: error: ld returned 1 exit status

Clearly, libosmovty is not listed as linked library. But for some reason, 
libtool still pulls in a libosmovty.
That's because of libosmoctrl.so!

▶ ldd src/ctrl/.libs/libosmoctrl.so
linux-vdso.so.1 (0x7ffced03f000)
libasan.so.5 => /usr/lib/x86_64-linux-gnu/libasan.so.5 
(0x7f26c291b000)
libtalloc.so.2 => /usr/lib/x86_64-linux-gnu/libtalloc.so.2 
(0x7f26c2903000)
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 
(0x7f26c26d4000)
libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f26c22bb000)
libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f26c2171000)
libubsan.so.1 => /usr/lib/x86_64-linux-gnu/libubsan.so.1 
(0x7f26c165)
[...]

It does so from /usr/local/lib in my case.

The solution is thus: any program built in libosmocore.git, here regression 
test binary, that links libosmoctrl,
*must* also make sure to link libosmovty and libosmogsm from the source tree, 
or the build works only when we're lucky.


--
To view, visit https://gerrit.osmocom.org/5844
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6
Gerrit-Change-Number: 5844
Gerrit-PatchSet: 4
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 11 Sep 2018 20:46:11 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Build failure of network:osmocom:nightly/simtrace2 in Debian_9.0/armv7l

2018-09-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/simtrace2/Debian_9.0/armv7l

Package network:osmocom:nightly/simtrace2 failed to build in Debian_9.0/armv7l

Check out the package for editing:
  osc checkout network:osmocom:nightly simtrace2

Last lines of build log:
[  273s] No package 'libpcsclite' found
[  273s] simtrace2-remsim.o: In function `main':
[  273s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:689: undefined 
reference to `osim_reader_open'
[  273s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:695: undefined 
reference to `osim_card_open'
[  273s] /usr/src/packages/BUILD/host/simtrace2-remsim.c:772: undefined 
reference to `osim_uicc_sim_cic_profile'
[  273s] apdu_dispatch.o: In function `apdu_segment_in':
[  273s] /usr/src/packages/BUILD/host/apdu_dispatch.c:84: undefined reference 
to `osim_determine_apdu_case'
[  273s] /usr/src/packages/BUILD/host/apdu_dispatch.c:173: undefined reference 
to `osim_uicc_sim_cic_profile'
[  273s] collect2: error: ld returned 1 exit status
[  273s] Makefile:9: recipe for target 'simtrace2-remsim' failed
[  273s] make[2]: *** [simtrace2-remsim] Error 1
[  273s] make[2]: Leaving directory '/usr/src/packages/BUILD/host'
[  273s] Makefile:20: recipe for target 'utils' failed
[  273s] make[1]: *** [utils] Error 2
[  273s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  273s] dh_auto_build: make -j1 returned exit code 2
[  273s] debian/rules:4: recipe for target 'build' failed
[  273s] make: *** [build] Error 2
[  273s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  273s] 
[  273s] armbuild01 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:55:51 UTC 2018.
[  273s] 
[  273s] ### VM INTERACTION START ###
[  276s] [  246.604350] SysRq : Power Off
[  276s] [  246.610976] reboot: Power down
[  276s] ### VM INTERACTION END ###
[  276s] 
[  276s] armbuild01 failed "build simtrace2_0.5.1.15.5b5d.dsc" at Tue Sep 11 
20:55:54 UTC 2018.
[  276s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Change in libosmocore[master]: fix tests linking: don't use system installed libs

2018-09-11 Thread Neels Hofmeyr
Hello Vadim Yanitskiy, Max, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/5844

to look at the new patch set (#5).

Change subject: fix tests linking: don't use system installed libs
..

fix tests linking: don't use system installed libs

Do not link against the system-wide installed libosmo* libs when building the
regression test programs. Always use the locally built ones.

Linking some libosmo libraries causes libtool to pull in other libosmo libs
even though they were not explicitly named. For example, ctrl_test explicitly
links libosmoctrl, but this also has dependencies to libosmovty and libosmogsm:

  ldd src/ctrl/.libs/libosmoctrl.so | grep osmo
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f26c26d4000)
libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f26c22bb000)
libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f26c2171000)

If we omit explicit LDADD of these dependencies in the Makefile.am, libtool
will take the first canonical place to find them, which may just be the already
installed older versions of the same libs, which may or may not be compatible
with the current build. In any case, it is never intended to link installed
libs.

All library dependencies are listed by this quick script:

  cd libosmocore
  for l in $(find . -name "*.so") ; do echo; echo "$l"; ldd $l | grep libosmo; 
done

  ./.libs/libosmocore.so

  ./coding/.libs/libosmocoding.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f25fc3c2000)
libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f25fbfa9000)
libosmocodec.so.0 => /usr/local/lib/libosmocodec.so.0 (0x7f25fbf9b000)

  ./codec/.libs/libosmocodec.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7fb4c900d000)

  ./ctrl/.libs/libosmoctrl.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f5df5129000)
libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f5df4d1)
libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f5df4bc6000)

  ./gb/.libs/libosmogb.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f788e536000)
libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f788e3ec000)
libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f788dfd3000)

  ./vty/.libs/libosmovty.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f3b7ed21000)

  ./gsm/.libs/libosmogsm.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7fc69472e000)

  ./sim/.libs/libosmosim.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f2f6412d000)
libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f2f63d14000)

Add all explicit linking of all required library dependencies in all regression
test programs, as shown by above listing.

Example for reproducing a problem:

In libosmocore.a, introduce a new function, and call that from libosmovty code.
For example, I made loglevel_strs non-static in logging.c, and used that in
logging_vty.c. Build and install this in a place where libtool can find it.
Then go back to before this change and rebuild. You will see that linking
ctrl_test (before this patch) then complains about libosmovty requiring the
loglevel_strs symbol which it cannot find in libosmocore.so.

Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6
---
M tests/Makefile.am
1 file changed, 13 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/5844/5
--
To view, visit https://gerrit.osmocom.org/5844
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6
Gerrit-Change-Number: 5844
Gerrit-PatchSet: 5
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in libosmocore[master]: fix tests linking: don't use system installed libs

2018-09-11 Thread Neels Hofmeyr
Hello Vadim Yanitskiy, Max, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/5844

to look at the new patch set (#6).

Change subject: fix tests linking: don't use system installed libs
..

fix tests linking: don't use system installed libs

Do not link against the system-wide installed libosmo* libs when building the
regression test programs. Always use the locally built ones.

Linking some libosmo libraries causes libtool to pull in other libosmo libs
even though they were not explicitly named. For example, ctrl_test explicitly
links libosmoctrl, but this also has dependencies to libosmovty and libosmogsm:

  ldd src/ctrl/.libs/libosmoctrl.so | grep osmo
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f26c26d4000)
libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f26c22bb000)
libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f26c2171000)

If we omit explicit LDADD of these dependencies in the Makefile.am, libtool
will take the first canonical place to find them, which may just be the already
installed older versions of the same libs, which may or may not be compatible
with the current build. In any case, it is never intended to link installed
libs.

All library dependencies are listed by this quick script:

  cd libosmocore
  for l in $(find . -name "*.so") ; do echo; echo "$l"; ldd $l | grep libosmo; 
done

  ./.libs/libosmocore.so

  ./coding/.libs/libosmocoding.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f25fc3c2000)
libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f25fbfa9000)
libosmocodec.so.0 => /usr/local/lib/libosmocodec.so.0 (0x7f25fbf9b000)

  ./codec/.libs/libosmocodec.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7fb4c900d000)

  ./ctrl/.libs/libosmoctrl.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f5df5129000)
libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f5df4d1)
libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f5df4bc6000)

  ./gb/.libs/libosmogb.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f788e536000)
libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x7f788e3ec000)
libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f788dfd3000)

  ./vty/.libs/libosmovty.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f3b7ed21000)

  ./gsm/.libs/libosmogsm.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7fc69472e000)

  ./sim/.libs/libosmosim.so
libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x7f2f6412d000)
libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x7f2f63d14000)

Add all explicit linking of all required library dependencies in all regression
test programs, as shown by above listing.

Example for reproducing a problem:

In libosmocore.a, introduce a new function, and call that from libosmovty code.
For example, I made loglevel_strs non-static in logging.c, and used that in
logging_vty.c. Build and install this in a place where libtool can find it.
Then go back to before this change and rebuild. You will see that linking
ctrl_test (before this patch) then complains about libosmovty requiring the
loglevel_strs symbol which it cannot find in libosmocore.so.

Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6
---
M tests/Makefile.am
1 file changed, 13 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/5844/6
--
To view, visit https://gerrit.osmocom.org/5844
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6
Gerrit-Change-Number: 5844
Gerrit-PatchSet: 6
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in gr-gsm[master]: Add .gitreview similar to the other osmocom's projects

2018-09-11 Thread Vasil Velichkov
Vasil Velichkov has uploaded this change for review. ( 
https://gerrit.osmocom.org/10882


Change subject: Add .gitreview similar to the other osmocom's projects
..

Add .gitreview similar to the other osmocom's projects

A gitreview file is required to use git review.
More information about git review
https://docs.openstack.org/infra/git-review/
https://www.mediawiki.org/wiki/Gerrit/git-review

Change-Id: Ie07446ba1a13e53c87bcc9b23e3b775803d158f4
---
A .gitreview
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/82/10882/1

diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..85e5df7
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,3 @@
+[gerrit]
+host=gerrit.osmocom.org
+project=gr-gsm

--
To view, visit https://gerrit.osmocom.org/10882
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie07446ba1a13e53c87bcc9b23e3b775803d158f4
Gerrit-Change-Number: 10882
Gerrit-PatchSet: 1
Gerrit-Owner: Vasil Velichkov 


Change in libosmocore[master]: logging vty: write: check logging levels validity

2018-09-11 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10887


Change subject: logging vty: write: check logging levels validity
..

logging vty: write: check logging levels validity

Change-Id: If683b1272ad2d5b402b91c52c496aa7975bc6315
---
M src/vty/logging_vty.c
1 file changed, 21 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/87/10887/1

diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index d0a9421..1f5cf2a 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -861,21 +861,35 @@
get_value_string(logging_print_file_args, tgt->print_filename2),
VTY_NEWLINE);

-   if (tgt->loglevel)
-   vty_out(vty, "  logging level all %s%s",
-   get_value_string(loglevel_strs_lower, tgt->loglevel),
-   VTY_NEWLINE);
+   if (tgt->loglevel) {
+   const char *level_str = 
get_value_string_or_null(loglevel_strs_lower, tgt->loglevel);
+   if (!level_str)
+   vty_out(vty, "%% Invalid log level %u for 'all'%s", 
tgt->loglevel, VTY_NEWLINE);
+   else
+   vty_out(vty, "  logging level all %s%s", level_str, 
VTY_NEWLINE);
+   }

for (i = 0; i < osmo_log_info->num_cat; i++) {
const struct log_category *cat = &tgt->categories[i];
+   const char *cat_name;
+   const char *level_str;

/* skip empty entries in the array */
if (!osmo_log_info->cat[i].name)
continue;

-   /* stupid old osmo logging API uses uppercase strings... */
-   vty_out(vty, "  logging level %s", 
osmo_str_tolower(osmo_log_info->cat[i].name+1));
-   vty_out(vty, " %s%s", get_value_string(loglevel_strs_lower, 
cat->loglevel), VTY_NEWLINE);
+   /* Note: cat_name references the static buffer returned by 
osmo_str_tolower(), will
+* become invalid after next osmo_str_tolower() invocation. */
+   cat_name = osmo_str_tolower(osmo_log_info->cat[i].name+1);
+
+   level_str = get_value_string_or_null(loglevel_strs_lower, 
cat->loglevel);
+   if (!level_str) {
+   vty_out(vty, "%% Invalid log level %u for %s%s", 
cat->loglevel, cat_name,
+   VTY_NEWLINE);
+   continue;
+   }
+
+   vty_out(vty, "  logging level %s %s%s", cat_name, level_str, 
VTY_NEWLINE);
}

return 1;

--
To view, visit https://gerrit.osmocom.org/10887
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If683b1272ad2d5b402b91c52c496aa7975bc6315
Gerrit-Change-Number: 10887
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in libosmocore[master]: logging vty: rewrite 'logging level' vty cmd generation

2018-09-11 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10884


Change subject: logging vty: rewrite 'logging level' vty cmd generation
..

logging vty: rewrite 'logging level' vty cmd generation

Completely drop the implementations of log_vty_command_{str,description}().
These functions have been public API once, marked as deprecated since
c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7 (March 2017). I considered to keep
them, or reduce them to useless stubs, but it is quite silly, really. These
functions are completely and utterly useless outside of libosmocore. Any
program linking these deserves to fail.

Re-implement vty logging level command gen, in logging_vty.c. logging.c is
simply the wrong place for that.

Introduce logging_internal.h to share logging definitions to logging_vty.c
without publishing as API.

Introduce static gen_logging_level_cmd_strs() to compose a list of category
arguments with their descriptions for VTY commands. Use osmo_talloc_asprintf()
instead of the previous error prone and chaotic strlen() counting method.

Do not dynamically generate log level arguments, just keep static strings. We
are super unlikely to ever change the log levels we have.

No changes in logging_vty_test.vty: proves that there is no functional change.

All of this, besides introducing basic sanity, is cosmetic preparation to be
able to re-use the generic command generation code for arbitrary commands with
category or level args (for deprecated and new keywords).

Rationale: I want to hide 'all' and 'everything' from the VTY command
documentation, by means of deprecating. I first tried to simply define a
deprecated 'logging level CAT everything' command:

  logging level (all|rsl|rr|...) (debug|info|notice|error|fatal)
  logging level CAT everything   # <- deprecated and hidden

But unfortunately, command matching doesn't work as intended when the CAT
argument reflects a valid category; I want it to invoke the deprecated function
as soon as the 'everything' keyword follows, but it stays stuck to the "valid"
command when the category argument matches an explicit keyword in that list,
and will throw an error on the following 'everything' keyword. I.e.:

  logging level rsl everything
  % Unknown command  # <-- leads to config file parse error

  logging level unknown_string everything
  % Ignoring deprecated 'everything'  # <-- works only for invalid categories

So I need to define 'everything' separately, again with a list of each valid
category instead of a generic CAT arg.

Change-Id: I3b083f27e3d751ccec258880ae7676e9af959a63
---
M include/Makefile.am
M include/osmocom/core/logging.h
A include/osmocom/core/logging_internal.h
M src/logging.c
M src/vty/logging_vty.c
5 files changed, 82 insertions(+), 172 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/10884/1

diff --git a/include/Makefile.am b/include/Makefile.am
index ef8ec65..19695d1 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -152,7 +152,10 @@
 endif

 noinst_HEADERS = \
-   osmocom/gsm/kasumi.h osmocom/gsm/gea.h
+   osmocom/gsm/kasumi.h \
+   osmocom/gsm/gea.h \
+   osmocom/core/logging_internal.h \
+   $(NULL)

 osmocom/core/bit%gen.h: osmocom/core/bitXXgen.h.tpl
$(AM_V_GEN)$(MKDIR_P) $(dir $@)
diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h
index c60143d..295e5a8 100644
--- a/include/osmocom/core/logging.h
+++ b/include/osmocom/core/logging.h
@@ -374,10 +374,6 @@
 void log_add_target(struct log_target *target);
 void log_del_target(struct log_target *target);

-/* Generate command string for VTY use */
-const char *log_vty_command_string() OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE;
-const char *log_vty_command_description() OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE;
-
 struct log_target *log_target_find(int type, const char *fname);
 extern struct llist_head osmo_log_target_list;

diff --git a/include/osmocom/core/logging_internal.h 
b/include/osmocom/core/logging_internal.h
new file mode 100644
index 000..55b1bbd
--- /dev/null
+++ b/include/osmocom/core/logging_internal.h
@@ -0,0 +1,14 @@
+#pragma once
+
+/*! \defgroup logging_internal Osmocom logging internals
+ *  @{
+ * \file logging_internal.h */
+
+#include 
+
+extern void *tall_log_ctx;
+extern const struct log_info *osmo_log_info;
+
+void assert_loginfo(const char *src);
+
+/*! @} */
diff --git a/src/logging.c b/src/logging.c
index de0f2b0..7c2d61f 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -35,7 +35,6 @@
 #include 
 #include 
 #include 
-#include 

 #ifdef HAVE_STRINGS_H
 #include 
@@ -61,12 +60,10 @@
 struct log_info *osmo_log_info;

 static struct log_context log_context;
-static void *tall_log_ctx = NULL;
+void *tall_log_ctx = NULL;
 LLIST_HEAD(osmo_log_target_list);

-#define LOGLEVEL_DEFS  6   /* Number of loglevels.*/
-
-static const struct value_string loglevel_strs[LOG

Change in libosmocore[master]: jenkins: add --enable-external-tests

2018-09-11 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10890


Change subject: jenkins: add --enable-external-tests
..

jenkins: add --enable-external-tests

Run the new logging_vty_test.vty VTY transcript test in our CI.

Change-Id: Ic4ec1f6c131da50b3956f16f0b49375f387196b3
---
M contrib/jenkins_amd64.sh
M contrib/jenkins_arm.sh
2 files changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/90/10890/1

diff --git a/contrib/jenkins_amd64.sh b/contrib/jenkins_amd64.sh
index c3af378..cd7b666 100755
--- a/contrib/jenkins_amd64.sh
+++ b/contrib/jenkins_amd64.sh
@@ -15,7 +15,8 @@

 prep_build "$src_dir" "$build_dir"

-"$src_dir"/configure  --disable-silent-rules --enable-static 
$ENABLE_SANITIZE --enable-werror
+"$src_dir"/configure  --disable-silent-rules --enable-static 
$ENABLE_SANITIZE --enable-werror \
+--enable-external-tests

 run_make
 }
diff --git a/contrib/jenkins_arm.sh b/contrib/jenkins_arm.sh
index 1d72f2f..e3a6cd1 100755
--- a/contrib/jenkins_arm.sh
+++ b/contrib/jenkins_arm.sh
@@ -18,6 +18,7 @@
--enable-embedded \
--disable-doxygen \
--disable-shared \
+   --enable-external-tests \
CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles 
-nodefaultlibs $WERROR_FLAGS"

 $MAKE $PARALLEL_MAKE

--
To view, visit https://gerrit.osmocom.org/10890
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4ec1f6c131da50b3956f16f0b49375f387196b3
Gerrit-Change-Number: 10890
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in libosmocore[master]: logging: define lower-case loglevel value_string[]

2018-09-11 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10886


Change subject: logging: define lower-case loglevel value_string[]
..

logging: define lower-case loglevel value_string[]

Instead of constantly converting logging level strings to lowercase
representation during VTY interaction, just define loglevel_strs_lower[] and
use those.

I'm not defining a log_level_str_lower() function to wrap get_value_string(),
because I already know that a later patch will switch to using
get_value_string_or_null().

Change-Id: Ie55d732281bdf74324e1dd7f8a2ba91d11409851
---
M include/osmocom/core/logging_internal.h
M src/logging.c
M src/vty/logging_vty.c
3 files changed, 15 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/86/10886/1

diff --git a/include/osmocom/core/logging_internal.h 
b/include/osmocom/core/logging_internal.h
index 55b1bbd..96b80a3 100644
--- a/include/osmocom/core/logging_internal.h
+++ b/include/osmocom/core/logging_internal.h
@@ -9,6 +9,8 @@
 extern void *tall_log_ctx;
 extern const struct log_info *osmo_log_info;

+extern const struct value_string loglevel_strs_lower[];
+
 void assert_loginfo(const char *src);

 /*! @} */
diff --git a/src/logging.c b/src/logging.c
index 67470a5..159838c 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -72,6 +72,16 @@
{ 0, NULL },
 };

+/*! human readable string for each log level, lower case */
+const struct value_string loglevel_strs_lower[] = {
+   { LOGL_DEBUG,   "debug" },
+   { LOGL_INFO,"info" },
+   { LOGL_NOTICE,  "notice" },
+   { LOGL_ERROR,   "error" },
+   { LOGL_FATAL,   "fatal" },
+   { 0, NULL },
+};
+
 #define INT2IDX(x) (-1*(x)-1)
 static const struct log_info_cat internal_cat[OSMO_NUM_DLIB] = {
[INT2IDX(DLGLOBAL)] = { /* -1 becomes 0 */
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 6758dd2..d0a9421 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -861,9 +861,9 @@
get_value_string(logging_print_file_args, tgt->print_filename2),
VTY_NEWLINE);

-   /* stupid old osmo logging API uses uppercase strings... */
if (tgt->loglevel)
-   vty_out(vty, "  logging level all %s%s", 
osmo_str_tolower(log_level_str(tgt->loglevel)),
+   vty_out(vty, "  logging level all %s%s",
+   get_value_string(loglevel_strs_lower, tgt->loglevel),
VTY_NEWLINE);

for (i = 0; i < osmo_log_info->num_cat; i++) {
@@ -875,7 +875,7 @@

/* stupid old osmo logging API uses uppercase strings... */
vty_out(vty, "  logging level %s", 
osmo_str_tolower(osmo_log_info->cat[i].name+1));
-   vty_out(vty, " %s%s", 
osmo_str_tolower(log_level_str(cat->loglevel)), VTY_NEWLINE);
+   vty_out(vty, " %s%s", get_value_string(loglevel_strs_lower, 
cat->loglevel), VTY_NEWLINE);
}

return 1;

--
To view, visit https://gerrit.osmocom.org/10886
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie55d732281bdf74324e1dd7f8a2ba91d11409851
Gerrit-Change-Number: 10886
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in libosmocore[master]: logging vty: add 'logging level set-all '

2018-09-11 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10889


Change subject: logging vty: add 'logging level set-all '
..

logging vty: add 'logging level set-all '

Add new command to once-off set each and every category to the given log level,
as discussed at length on the openbsc@ mailing list.

Show that it works in logging_vty_test.vty.

Change-Id: I4c3e4f786476cb813fdc0a7c64f30ee04758309d
---
M src/vty/logging_vty.c
M tests/logging/logging_vty_test.vty
2 files changed, 185 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/10889/1

diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 0878e1f..1812da3 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -354,6 +354,28 @@
return CMD_SUCCESS;
 }

+DEFUN(logging_level_set_all, logging_level_set_all_cmd,
+  "logging level set-all " LOG_LEVEL_ARGS,
+  LOGGING_STR LEVEL_STR
+  "Once-off set all categories to the given log level. There is no single 
command"
+  " to take back these changes -- each category is set to the given level, 
period.\n"
+  LOG_LEVEL_STRS)
+{
+   struct log_target *tgt = osmo_log_vty2tgt(vty);
+   int level = log_parse_level(argv[0]);
+   int i;
+   for (i = 0; i < osmo_log_info->num_cat; i++) {
+   struct log_category *cat = &tgt->categories[i];
+   /* skip empty entries in the array */
+   if (!osmo_log_info->cat[i].name)
+   continue;
+
+   cat->enabled = 1;
+   cat->loglevel = level;
+   }
+   return CMD_SUCCESS;
+}
+
 /* logging level () everything */
 DEFUN_DEPRECATED(deprecated_logging_level_everything, 
deprecated_logging_level_everything_cmd,
 NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). 
*/
@@ -981,6 +1003,7 @@
   "everything", EVERYTHING_STR);

install_element_ve(&logging_level_cmd);
+   install_element_ve(&logging_level_set_all_cmd);
install_element_ve(&logging_level_force_all_cmd);
install_element_ve(&no_logging_level_force_all_cmd);
install_element_ve(&deprecated_logging_level_everything_cmd);
@@ -999,6 +1022,7 @@
install_element(CFG_LOG_NODE, &logging_prnt_level_cmd);
install_element(CFG_LOG_NODE, &logging_prnt_file_cmd);
install_element(CFG_LOG_NODE, &logging_level_cmd);
+   install_element(CFG_LOG_NODE, &logging_level_set_all_cmd);
install_element(CFG_LOG_NODE, &logging_level_force_all_cmd);
install_element(CFG_LOG_NODE, &no_logging_level_force_all_cmd);
install_element(CFG_LOG_NODE, &deprecated_logging_level_everything_cmd);
diff --git a/tests/logging/logging_vty_test.vty 
b/tests/logging/logging_vty_test.vty
index 03b0c4a..0c552a5 100644
--- a/tests/logging/logging_vty_test.vty
+++ b/tests/logging/logging_vty_test.vty
@@ -51,6 +51,7 @@
   logging print file (0|1|basename) [last]
   logging set-log-mask MASK
   logging level 
(aa|bb|ccc||eee|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf)
 (debug|info|notice|error|fatal)
+  logging level set-all (debug|info|notice|error|fatal)
   logging level force-all (debug|info|notice|error|fatal)
   no logging level force-all
 ... !^  logging
@@ -74,6 +75,7 @@
   eeeExhaustive Entropy Extraction (EEE)
   lglobalLibrary-internal global log family
 ... ! all
+  set-allOnce-off set all categories to the given log level. There is no 
single command to take back these changes -- each category is set to the given 
level, period.
   force-all  Globally force all logging categories to a specific level. This 
is released by the 'no logging level force-all' command. Note: any 'logging 
level  ' commands will have no visible effect after this, 
until the forced level is released.

 logging_vty_test# logging level aa ?
@@ -96,6 +98,13 @@
 logging_vty_test# no logging level ?
   force-all  Release any globally forced log level set with 'logging level 
force-all '

+logging_vty_test# logging level set-all ?
+  debug   Log debug messages and higher levels
+  infoLog informational messages and higher levels
+  notice  Log noticeable messages and higher levels
+  error   Log error messages and higher levels
+  fatal   Log only fatal messages
+

 logging_vty_test# log-sweep
 DAA DEBUG Log message for DAA on level LOGL_DEBUG
@@ -304,3 +313,155 @@
 D ERROR Log message for D on level LOGL_ERROR
 D FATAL Log message for D on level LOGL_FATAL
 DEEE FATAL Log message for DEEE on level LOGL_FATAL
+
+
+logging_vty_test# ! test 'set-all'
+logging_vty_test# logging level set-all fatal
+logging_vty_test# log-sweep
+DAA FATAL Log message for DAA on level LOGL_FATAL
+DBB FATAL Log message for DBB on level LOGL_FATAL
+DCCC FATAL Log message for DCCC on level LOGL_FATA

Change in libosmocore[master]: logging vty: add VTY transcript test

2018-09-11 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10883


Change subject: logging vty: add VTY transcript test
..

logging vty: add VTY transcript test

I am setting out to refactor various details about logging. To show the effect,
I am first adding this new test to illustrate the exact effects on the various
osmo programs.

Add logging_vty_test.c as a standalone program that simply defines a few
logging categories and opens a telnet vty to play with.

Add logging_vty_test.vty, as an osmo_verify_transcript_vty.py test script.

Add --enable-external-tests to configure.ac, to enable running
logging_vty_test.vty during 'make check'.

Also allow running 'make vty-test' without the need to first configure with
--enable-external-tests (a flexibility I've missed many times over in the other
osmo source trees).

Add a Makefile.am stub for external CTRL tests, basically a copy-paste from
osmo-msc.git. I doubt that libosmocore will get python driven CTRL interface
testing any time soon, but if so we will know to not run it concurrently.

Change-Id: I948e832a33131f8eab98651d6010ceb0ccbc9a9c
---
M configure.ac
M tests/Makefile.am
A tests/logging/logging_vty_test.c
A tests/logging/logging_vty_test.vty
4 files changed, 530 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/10883/1

diff --git a/configure.ac b/configure.ac
index dd5f15b..bc3358a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,6 +296,21 @@
CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
 fi

+AC_ARG_ENABLE([external_tests],
+   AC_HELP_STRING([--enable-external-tests],
+   [Include the VTY/CTRL tests in make check 
[default=no]]),
+   [enable_ext_tests="$enableval"],[enable_ext_tests="no"])
+if test "x$enable_ext_tests" = "xyes" ; then
+   AM_PATH_PYTHON
+   AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmo_verify_transcript_vty.py,yes)
+if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
+   AC_MSG_ERROR([Please install 
git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.])
+   fi
+fi
+AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
+AC_MSG_RESULT([$enable_ext_tests])
+AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
+
 CFLAGS="$CFLAGS -DBUILDING_LIBOSMOCORE -Wall"
 CPPFLAGS="$CPPFLAGS -DBUILDING_LIBOSMOCORE -Wall"

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5d07695..18d4bb4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -24,7 +24,9 @@
 abis/abis_test endian/endian_test sercomm/sercomm_test \
 prbs/prbs_test gsm23003/gsm23003_test  \
 codec/codec_ecu_fr_test timer/clk_override_test\
-oap/oap_client_test
+oap/oap_client_test\
+logging/logging_vty_test   \
+$(NULL)

 if ENABLE_MSGFILE
 check_PROGRAMS += msgfile/msgfile_test
@@ -148,6 +150,9 @@

 logging_logging_test_SOURCES = logging/logging_test.c

+logging_logging_vty_test_SOURCES = logging/logging_vty_test.c
+logging_logging_vty_test_LDADD = $(LDADD) $(top_builddir)/src/vty/libosmovty.la
+
 fr_fr_test_SOURCES = fr/fr_test.c
 fr_fr_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la 
$(LIBRARY_DLSYM) \
   $(top_builddir)/src/vty/libosmovty.la \
@@ -280,6 +285,7 @@
 check-local: atconfig $(TESTSUITE)
cat /proc/cpuinfo
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
+   $(MAKE) $(AM_MAKEFLAGS) ext-tests

 installcheck-local: atconfig $(TESTSUITE)
$(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
@@ -298,3 +304,25 @@
 conv/gsm0503_test_vectors.c: $(top_srcdir)/utils/conv_gen.py 
$(top_srcdir)/utils/conv_codes_gsm.py
$(AM_V_GEN)python $(top_srcdir)/utils/conv_gen.py gen_vectors gsm \
--target-path $(builddir)/conv
+
+if ENABLE_EXT_TESTS
+ext-tests:
+# don't run vty and ctrl tests concurrently so that the ports don't conflict
+   $(MAKE) vty-test
+   $(MAKE) ctrl-test
+else
+ext-tests:
+   echo "Not running python-based external tests (determined at 
configure-time)"
+endif
+
+# To update the VTY script from current application behavior,
+# pass -u to osmo_verify_transcript_vty.py by doing:
+#   make vty-test U=-u
+vty-test:
+   osmo_verify_transcript_vty.py -v \
+   -p 42042 \
+   -r "$(top_builddir)/tests/logging/logging_vty_test" \
+   $(U) $(srcdir)/logging/*.vty
+
+ctrl-test:
+   echo "No CTRL tests exist currently"
diff --git a/tests/logging/logging_vty_test.c b/tests/logging/logging_vty_test.c
new file mode 100644
index 000..806a460
--- /dev/null
+++ b/tests/logging/logging_vty_test.c
@@ -0,0 +1,296 @@
+/* test program with a vty interface to test logging behavior */
+/*
+ * (C) 2018 by sysmocom - s.

Change in libosmocore[master]: logging vty: deprecate the 'everything' keyword

2018-09-11 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10885


Change subject: logging vty: deprecate the 'everything' keyword
..

logging vty: deprecate the 'everything' keyword

The 'logging level all everything' has not had an effect for some time now. The
plan is to bring back its old functionality, but to keep it deprecated and
rather define a less confusing name.

* Deprecate 'everything'.
* Do not write 'everything' during 'write file' or 'show running-config', which
  we curiously still do until now.

BTW, the reason why we need to compose a complete list of categories for the
deprecated 'everything' command is explained in detail in the commit log for
I3b083f27e3d751ccec258880ae7676e9af959a63

Change-Id: Ib75fedb0572570a61bb34ee729a2af86cf5f16da
---
M src/logging.c
M src/vty/logging_vty.c
M tests/logging/logging_vty_test.vty
3 files changed, 35 insertions(+), 30 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/10885/1

diff --git a/src/logging.c b/src/logging.c
index 7c2d61f..67470a5 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -64,7 +64,6 @@
 LLIST_HEAD(osmo_log_target_list);

 static const struct value_string loglevel_strs[] = {
-   { 0,"EVERYTHING" },
{ LOGL_DEBUG,   "DEBUG" },
{ LOGL_INFO,"INFO" },
{ LOGL_NOTICE,  "NOTICE" },
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 2b001bc..6758dd2 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -320,7 +320,7 @@
cmd->doc = doc_str;
 }

-/* logging level (all|) (everything|debug|...|fatal) */
+/* logging level (all|) (debug|...|fatal) */
 DEFUN(logging_level,
   logging_level_cmd,
   NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */
@@ -338,11 +338,6 @@
return CMD_WARNING;
}

-   if (strcmp(argv[1], "everything") == 0) { /* FIXME: remove this check 
once 'everything' is phased out */
-   vty_out(vty, "%% Ignoring deprecated logging level %s%s", 
argv[1], VTY_NEWLINE);
-   return CMD_SUCCESS;
-   }
-
/* Check for special case where we want to set global log level */
if (!strcmp(argv[0], "all")) {
log_set_log_level(tgt, level);
@@ -360,6 +355,15 @@
return CMD_SUCCESS;
 }

+/* logging level (all|) everything */
+DEFUN_DEPRECATED(deprecated_logging_level_everything, 
deprecated_logging_level_everything_cmd,
+NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). 
*/
+NULL) /* same thing for helpstr. */
+{
+   vty_out(vty, "%% Ignoring deprecated logging level 'everything' 
keyword%s", VTY_NEWLINE);
+   return CMD_SUCCESS;
+}
+
 DEFUN(logging_set_category_mask,
   logging_set_category_mask_cmd,
   "logging set-log-mask MASK",
@@ -858,8 +862,9 @@
VTY_NEWLINE);

/* stupid old osmo logging API uses uppercase strings... */
-   vty_out(vty, "  logging level all %s%s", 
osmo_str_tolower(log_level_str(tgt->loglevel)),
-   VTY_NEWLINE);
+   if (tgt->loglevel)
+   vty_out(vty, "  logging level all %s%s", 
osmo_str_tolower(log_level_str(tgt->loglevel)),
+   VTY_NEWLINE);

for (i = 0; i < osmo_log_info->num_cat; i++) {
const struct log_category *cat = &tgt->categories[i];
@@ -896,7 +901,7 @@
 {
struct cmd_element *cmd = talloc_zero(ctx, struct cmd_element);
OSMO_ASSERT(cmd);
-   cmd->string = talloc_asprintf(cmd, "logging level %s 
(everything|debug|info|notice|error|fatal)",
+   cmd->string = talloc_asprintf(cmd, "logging level %s 
(debug|info|notice|error|fatal)",
name);
printf("%s\n", cmd->string);
cmd->func = log_deprecated_func;
@@ -924,12 +929,16 @@
install_element_ve(&logging_set_category_mask_cmd);
install_element_ve(&logging_set_category_mask_old_cmd);

-   /* logging level (all|) (everything|debug|...|fatal) */
+   /* logging level (all|) (debug|...|fatal) */
gen_logging_level_cmd_strs(&logging_level_cmd,
-  "(everything|" LOG_LEVEL_ARGS ")",
-  EVERYTHING_STR LOG_LEVEL_STRS);
+  "(" LOG_LEVEL_ARGS ")",
+  LOG_LEVEL_STRS);
+   /* logging level (all|) everything */
+   gen_logging_level_cmd_strs(&deprecated_logging_level_everything_cmd,
+  "everything", EVERYTHING_STR);

install_element_ve(&logging_level_cmd);
+   install_element_ve(&deprecated_logging_level_everything_cmd);
install_element_ve(&show_logging_vty_cmd);
install_element_ve(&show_alarms_cmd);

@@ -943,6 +952,7 @@
install_element(CFG_LOG_NODE, &logging_prnt_level_cmd);
install_element(CFG_LOG_NODE,

Change in libosmocore[master]: logging vty: deprecate 'all', introduce 'force-all'

2018-09-11 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10888


Change subject: logging vty: deprecate 'all', introduce 'force-all'
..

logging vty: deprecate 'all', introduce 'force-all'

Add 'logging level force-all ' and 'no logging level force-all' as new
names for 'logging level all ' and 'logging level all everything'.

Resurrect the functionality of 'logging level all everything' -- even if it is
still deprecated because the name is confusing, it is now just an alias for
'no logging level force-all'.

Show in logging_vty_test.vty that we can now again lift the global logging
clamp, both with the new commands as well as with the deprecated ones.
Also show that 'force-all' is written back properly, if set.

Change-Id: I36f17c131cc70ce5a1aef62fd9693097de230cd4
---
M src/vty/logging_vty.c
M tests/logging/logging_vty_test.vty
2 files changed, 190 insertions(+), 33 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/10888/1

diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 1f5cf2a..0878e1f 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -43,9 +43,15 @@
 #define LOG_STR "Configure logging sub-system\n"
 #define LEVEL_STR "Set the log level for a specified category\n"

-#define CATEGORY_ALL_STR "Global setting for all subsystems\n"
+#define CATEGORY_ALL_STR "Deprecated alias for 'force-all'\n"
+#define FORCE_ALL_STR \
+   "Globally force all logging categories to a specific level. This is 
released by the" \
+   " 'no logging level force-all' command. Note: any 'logging level 
 '" \
+   " commands will have no visible effect after this, until the forced 
level is released.\n"
+#define NO_FORCE_ALL_STR \
+   "Release any globally forced log level set with 'logging level 
force-all '\n"

-#define LOG_LEVEL_ARGS "debug|info|notice|error|fatal"
+#define LOG_LEVEL_ARGS "(debug|info|notice|error|fatal)"
 #define LOG_LEVEL_STRS \
"Log debug messages and higher levels\n" \
"Log informational messages and higher levels\n" \
@@ -53,7 +59,7 @@
"Log error messages and higher levels\n" \
"Log only fatal messages\n"

-#define EVERYTHING_STR "Don't use. It doesn't log anything\n"
+#define EVERYTHING_STR "Deprecated alias for 'no logging level force-all'\n"

 /*! \file logging_vty.c
  *  Configuration of logging from VTY
@@ -307,11 +313,10 @@
OSMO_ASSERT(cmd->string == NULL);
OSMO_ASSERT(cmd->doc == NULL);

-   osmo_talloc_asprintf(tall_log_ctx, cmd_str, "logging level (all|");
+   osmo_talloc_asprintf(tall_log_ctx, cmd_str, "logging level (");
osmo_talloc_asprintf(tall_log_ctx, doc_str,
 LOGGING_STR
-LEVEL_STR
-CATEGORY_ALL_STR);
+LEVEL_STR);
add_category_strings(&cmd_str, &doc_str, osmo_log_info);
osmo_talloc_asprintf(tall_log_ctx, cmd_str, ") %s", level_args);
osmo_talloc_asprintf(tall_log_ctx, doc_str, "%s", level_strs);
@@ -320,7 +325,7 @@
cmd->doc = doc_str;
 }

-/* logging level (all|) (debug|...|fatal) */
+/* logging level () (debug|...|fatal) */
 DEFUN(logging_level,
   logging_level_cmd,
   NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */
@@ -338,12 +343,6 @@
return CMD_WARNING;
}

-   /* Check for special case where we want to set global log level */
-   if (!strcmp(argv[0], "all")) {
-   log_set_log_level(tgt, level);
-   return CMD_SUCCESS;
-   }
-
if (category < 0) {
vty_out(vty, "Invalid category `%s'%s", argv[0], VTY_NEWLINE);
return CMD_WARNING;
@@ -355,7 +354,7 @@
return CMD_SUCCESS;
 }

-/* logging level (all|) everything */
+/* logging level () everything */
 DEFUN_DEPRECATED(deprecated_logging_level_everything, 
deprecated_logging_level_everything_cmd,
 NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). 
*/
 NULL) /* same thing for helpstr. */
@@ -364,6 +363,35 @@
return CMD_SUCCESS;
 }

+DEFUN(logging_level_force_all, logging_level_force_all_cmd,
+  "logging level force-all " LOG_LEVEL_ARGS,
+  LOGGING_STR LEVEL_STR FORCE_ALL_STR LOG_LEVEL_STRS)
+{
+   struct log_target *tgt = osmo_log_vty2tgt(vty);
+   int level = log_parse_level(argv[0]);
+   log_set_log_level(tgt, level);
+   return CMD_SUCCESS;
+}
+
+DEFUN(no_logging_level_force_all, no_logging_level_force_all_cmd,
+  "no logging level force-all",
+  NO_STR LOGGING_STR LEVEL_STR NO_FORCE_ALL_STR)
+{
+   struct log_target *tgt = osmo_log_vty2tgt(vty);
+   log_set_log_level(tgt, 0);
+   return CMD_SUCCESS;
+}
+
+/* 'logging level all (debug|...|fatal)' */
+ALIAS_DEPRECATED(logging_level_force_all, deprecated_logging_level_all_cmd,
+"