Commit Graph

8 Commits

Author SHA1 Message Date
Jacob Erlbeck be37fb7db4 stats/test: Add tests to check VTY configuration
This commit adds tests to verify the stats related VTY configuration
commands.

Sponsored-by: On-Waves ehf
2015-08-22 01:34:05 +00:00
Jacob Erlbeck ca6602f476 vty/test: Refactor vty creation/deletion into separate functions
Currently this is part of the only test function that uses the
vty directly.

In preperation for more such test cases, this commit moves this code
into separate functions.

Sponsored-by: On-Waves ehf
2015-08-22 01:31:31 +00:00
Jacob Erlbeck adc900e0e3 stats/vty: Add stats configuration
This commit provides stats configuration similar to the log
configuration.

The following vty commands are added to the config node:
  stats reporter statsd          Create/Modify a statsd reporter
  no stats reporter statsd       Remove a statsd reporter

To actually configure a reporter, the config-stats node is entered
when the "stats reporter" command has succeeded. The following new
vty commands are available there:
  local-ip ADDR          Set the IP address to which we bind locally
  no local-ip            Do not bind to a certain IP address
  remote-ip ADDR         Set the remote IP address to which we connect
  remote-port <1-65535>  Set the remote port to which we connect
  prefix PREFIX          Set the item/counter name prefix
  no prefix              Do not use a prefix
  enable                 Enable the reporter
  disable                Disable the reporter

Sponsored-by: On-Waves ehf
2015-10-29 01:10:06 +01:00
Holger Hans Peter Freyther 2c9168cf34 vty: Make vty_event dispatch signals and use it in the testcase
The testcase didn't work on Ubuntu 12.04 because vty_create will
directly call vty_event (e.g. not through the plt). This means
that the approach to override vty_event in the testcase failed.

Use the signal interface of libosmocore and make the testcase
use it. The signals can be generally useful as well.
2013-10-10 20:21:33 +02:00
Holger Hans Peter Freyther 6ef71b062b vty: Fix compiler warning in the test 2013-09-10 11:17:46 +02:00
Jacob Erlbeck 0c987bd83b vty: Add vty_install_default() and use for the vty nodes
This adds the vty_install_default() function that is basically the
install_default() function plus the registration of the commands
'exit' and 'end'. The latter is only provided in subnodes of
ENABLED_NODE and CONFIG_NONE.

The VTY test program is extended to check these commands.

Ticket: OW#952
2013-09-08 10:49:52 +02:00
Jacob Erlbeck cd195fa267 vty: Support multi-char separators and end strings
In vty_cmd_string_from_valstr() include the real string lengths of
the sep and end arguments into the buffer size calculation.
2013-08-06 14:56:35 +02:00
Jacob Erlbeck ae15a2cac1 vty: Fix misusage of snprintf in vty/utils.c
Compiled with ubuntu 1204 (precise), where -Wformat-security is enabled by
-Wall.

Test yields ok, but the current implementation doesn't properly support
multi-character separators and end strings. So the test output is truncated.

Addresses:
utils.c: In function 'vty_cmd_string_from_valstr':
utils.c:84:2: warning: format not a string literal and no format arguments [-Wformat-security]
utils.c:84:2: warning: format not a string literal and no format arguments [-Wformat-security]
utils.c:108:2: warning: format not a string literal and no format arguments [-Wformat-security]
utils.c:108:2: warning: format not a string literal and no format arguments [-Wformat-security]
2013-08-06 14:56:30 +02:00