History log of /openbmc/obmc-console/test/ (Results 1 – 25 of 26)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
d6e8b64a18-Mar-2024 Medicine Yeh <medicinehy@gmail.com>

config: rename parse_logsize to be more generic

Rename config_parse_logsize to config_parse_bytesize.
A more generic name allows this function to be reused in other
config parsing purposes.

Change-

config: rename parse_logsize to be more generic

Rename config_parse_logsize to config_parse_bytesize.
A more generic name allows this function to be reused in other
config parsing purposes.

Change-Id: I3036c184669be17ddc0d194f275ea05d871341d1
Signed-off-by: Medicine Yeh <medicinehy@gmail.com>

show more ...

dfda5afb06-Jun-2023 Andrew Jeffery <andrew@aj.id.au>

config: Drop support for the `socket-id` configuration key

9a8f30ec5b58 ("obmc-console: Introduce console-id, deprecate socket-id")
replaces the `socket-id` configuration key with a better name. Now

config: Drop support for the `socket-id` configuration key

9a8f30ec5b58 ("obmc-console: Introduce console-id, deprecate socket-id")
replaces the `socket-id` configuration key with a better name. Now that
we've fixed up all in-tree users in OpenBMC with 7a612d4fa70f
("obmc-console: Convert configs from socket-id to console-id"), drop
support for `socket-id`.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ied35025a98db426e27891f32ed4bd661d0edb14c

show more ...

5ba20b5b12-May-2023 Ninad Palsule <ninadpalsule@us.ibm.com>

obmc-console: Consolidate handling of default socket-id

If console-id is not specified on command line or in the config file
then use the default value. ae2460d0b8e8 ("obmc-console: Provide a
defaul

obmc-console: Consolidate handling of default socket-id

If console-id is not specified on command line or in the config file
then use the default value. ae2460d0b8e8 ("obmc-console: Provide a
default value for `console-id`.") only implemented the default value for
naming the abstract listening socket and overlooked the new DBus path
naming convention. This caused issues during dbus registration:

```
obmc-console-server: Object name: /xyz/openbmc_project/console/(null)
obmc-console-server: Failed to issue method call: Invalid argument
```

Fixes: ae2460d0b8e8 ("obmc-console: Provide a default value for `console-id`.")
Change-Id: I6d0f7b23cc085992189cd4463129a6aae590b3e7
Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

show more ...

4e44c79012-May-2023 Andrew Jeffery <andrew@aj.id.au>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I1617773783af90585a0ff753b6fa548d614f4d09

show more ...

4dfefa9702-May-2023 Andrew Jeffery <andrew@aj.id.au>

test: ringbuffer-test-utils: Add stdlib.h for malloc()/free()

Include what we use to address clang-tidy issues:

```
Error while processing /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test

test: ringbuffer-test-utils: Add stdlib.h for malloc()/free()

Include what we use to address clang-tidy issues:

```
Error while processing /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/ringbuffer-test-utils.c.
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/ringbuffer-test-utils.c:25:2: error: call to undeclared library function 'free' with type 'void (void *)'; ISO C99 and later do not support implicit function declarations [clang-diagnostic-implicit-function-declaration]
free(ctx->data);
^
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/ringbuffer-test-utils.c:25:2: note: include the header <stdlib.h> or explicitly provide a declaration for 'free'
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/ringbuffer-test-utils.c:64:15: error: call to undeclared library function 'realloc' with type 'void *(void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [clang-diagnostic-implicit-function-declaration]
ctx->data = realloc(ctx->data, ctx->len + len);
^
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/ringbuffer-test-utils.c:64:15: note: include the header <stdlib.h> or explicitly provide a declaration for 'realloc'
```

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Icf6d9ab735fb035572e8953ec474afd81efa53e9

show more ...

b377362125-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

obmc-console: Remove autotools build system

After introducing the meson build system and switching over the bitbake
recipe there's no need to continue maintaining the autotools build.

Signed-off-by

obmc-console: Remove autotools build system

After introducing the meson build system and switching over the bitbake
recipe there's no need to continue maintaining the autotools build.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I49c808284e640e3c1efe1f9e555c31c7a3af041c

show more ...

dd4fa59120-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

test: test-config-parse-logsize: Fix invalid size_t format specifier

Caught by building under bitbake:

```
| arm-openbmc-linux-gnueabi-gcc -march=armv7-a -mfpu=vfpv4-d16 -mfloat-abi=hard -fstack-pr

test: test-config-parse-logsize: Fix invalid size_t format specifier

Caught by building under bitbake:

```
| arm-openbmc-linux-gnueabi-gcc -march=armv7-a -mfpu=vfpv4-d16 -mfloat-abi=hard -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/var/tmp/bitbake/build/p10bmc/tmp/work/p10bmc-openbmc-linux-gnueabi/obmc-console/1.0+gitAUTOINC+533f9702a3-r1/recipe-sysroot -Itest/test-config-parse-logsize.p -Itest -I../git/test -I. -I../git -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=gnu17 -D_GNU_SOURCE -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/var/tmp/bitbake/build/p10bmc/tmp/work/p10bmc-openbmc-linux-gnueabi/obmc-console/1.0+gitAUTOINC+533f9702a3-r1/git=/usr/src/debug/obmc-console/1.0+gitAUTOINC+533f9702a3-r1 -fdebug-prefix-map=/var/tmp/bitbake/build/p10bmc/tmp/work/p10bmc-openbmc-linux-gnueabi/obmc-console/1.0+gitAUTOINC+533f9702a3-r1/git=/usr/src/debug/obmc-console/1.0+gitAUTOINC+533f9702a3-r1 -fmacro-prefix-map=/var/tmp/bitbake/build/p10bmc/tmp/work/p10bmc-openbmc-linux-gnueabi/obmc-console/1.0+gitAUTOINC+533f9702a3-r1/build=/usr/src/debug/obmc-console/1.0+gitAUTOINC+533f9702a3-r1 -fdebug-prefix-map=/var/tmp/bitbake/build/p10bmc/tmp/work/p10bmc-openbmc-linux-gnueabi/obmc-console/1.0+gitAUTOINC+533f9702a3-r1/build=/usr/src/debug/obmc-console/1.0+gitAUTOINC+533f9702a3-r1 -fdebug-prefix-map=/var/tmp/bitbake/build/p10bmc/tmp/work/p10bmc-openbmc-linux-gnueabi/obmc-console/1.0+gitAUTOINC+533f9702a3-r1/recipe-sysroot= -fmacro-prefix-map=/var/tmp/bitbake/build/p10bmc/tmp/work/p10bmc-openbmc-linux-gnueabi/obmc-console/1.0+gitAUTOINC+533f9702a3-r1/recipe-sysroot= -fdebug-prefix-map=/var/tmp/bitbake/build/p10bmc/tmp/work/p10bmc-openbmc-linux-gnueabi/obmc-console/1.0+gitAUTOINC+533f9702a3-r1/recipe-sysroot-native= -fpic -O2 '-DSYSCONFDIR=""' -MD -MQ test/test-config-parse-logsize.p/test-config-parse-logsize.c.o -MF test/test-config-parse-logsize.p/test-config-parse-logsize.c.o.d -o test/test-config-parse-logsize.p/test-config-parse-logsize.c.o -c ../git/test/test-config-parse-logsize.c
| ../git/test/test-config-parse-logsize.c: In function 'test_config_parse_logsize':
| ../git/test/test-config-parse-logsize.c:56:60: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
| 56 | warn("[%zu] Str %s expected size %lu, got size %lu\n",
| | ~~^
| | |
| | long unsigned int
| | %u
| 57 | i, test_data[i].test_str,
| 58 | test_data[i].expected_size, size);
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | size_t {aka unsigned int}
| ../git/test/test-config-parse-logsize.c:56:74: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
| 56 | warn("[%zu] Str %s expected size %lu, got size %lu\n",
| | ~~^
| | |
| | long unsigned int
| | %u
| 57 | i, test_data[i].test_str,
| 58 | test_data[i].expected_size, size);
| | ~~~~
| | |
| | size_t {aka unsigned int}
| cc1: all warnings being treated as errors
```

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I70a8077f2ab990a3b5aaab85aad545411ebd0a04

show more ...

1b86844118-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

obmc-console: Fix ringbuffer-test-utils analysis

ninja's clang-tidy target barfs due to the strategy of including C files
into each other for test purposes. Help it out by moving the ringbuffer
stru

obmc-console: Fix ringbuffer-test-utils analysis

ninja's clang-tidy target barfs due to the strategy of including C files
into each other for test purposes. Help it out by moving the ringbuffer
struct definitions into console-server.h so it can find them when
analysing test/ringbuffer-test-utils.c.

obmc-console isn't a library, so it's not like we're trying to avoid
expanding API/ABI surface.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ifd4501d3ca7f3bb02c557a1c31364aadd2b26abe

show more ...

b70f871318-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

obmc-console: Fix readability-isolate-declaration

For example:

```
/usr/bin/clang-tidy -checks=-*, readability-isolate-declaration -export-fixes /tmp/tmpoo7fbs72/tmpo8xiwfxs.yaml -p=build /mnt/host

obmc-console: Fix readability-isolate-declaration

For example:

```
/usr/bin/clang-tidy -checks=-*, readability-isolate-declaration -export-fixes /tmp/tmpoo7fbs72/tmpo8xiwfxs.yaml -p=build /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/test-client-escape.c
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../config.c:61:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors]
char *name, *value;
^~~~~~~~~~~~~~~~~~~
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../config.c:62:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors]
char *p, *line;
^~~~~~~~~~~~~~~
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../config.c:110:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors]
size_t size, len;
^~~~~~~~~~~~~~~~~
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../config.c:170:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors]
struct config_item *item, *next;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../console-client.c:263:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors]
struct console_client _client, *client;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 warnings generated.
```

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ia7829b1672ea2dfb3fa020c7c48bd8266e6a1769

show more ...

2834c5b118-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

obmc-console: Fix readability-braces-around-statements

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I88d2bdcb15106298d83a1cf7176e069092820f1d

4ee419df18-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

obmc-console: Fix cert-dcl03-c,misc-static-assert

```
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../test/test-ringbuffer-boundary-read.c:17:2: error: found assert() that could be re

obmc-console: Fix cert-dcl03-c,misc-static-assert

```
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../test/test-ringbuffer-boundary-read.c:17:2: error: found assert() that could be replaced by static_assert() [cert-dcl03-c,misc-static-assert,-warnings-as-errors]
assert(sizeof(in_buf) * 2 > 10);
^~~~~~
static_assert , ""
```

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I53954938355723fb559c28285c88807b44a44d22

show more ...

5c359cc618-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

obmc-console: Fix bugprone-narrowing-conversions

For example:

```
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../console-server.c:769:9: error: narrowing conversion from 'ssize_t' (

obmc-console: Fix bugprone-narrowing-conversions

For example:

```
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../console-server.c:769:9: error: narrowing conversion from 'ssize_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
rc = read(console->tty_fd, buf, sizeof(buf));
^
```

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I67c158b411f1533ca3b5a62803116e95907e8c5b

show more ...

f2232d5f18-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

obmc-console: Fix bugprone-macro-parentheses

For example:

```
/usr/bin/clang-tidy -checks=-*, bugprone-macro-parentheses -export-fixes /tmp/tmpzth2fheg/tmp9x7dpgyc.yaml -p=build /mnt/host/andrew/ho

obmc-console: Fix bugprone-macro-parentheses

For example:

```
/usr/bin/clang-tidy -checks=-*, bugprone-macro-parentheses -export-fixes /tmp/tmpzth2fheg/tmp9x7dpgyc.yaml -p=build /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/console-server.c
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../console-server.h:150:43: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
^
()
```

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I10b93e2b3e16b51bcdf2adf113a38e67bce37e88

show more ...

5db8c79218-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

obmc-console: Fix bugprone-implicit-widening-of-multiplication-result

For example:

```
/usr/bin/clang-tidy -checks=-*, bugprone-implicit-widening-of-multiplication-result -export-fixes /tmp/tmpppty

obmc-console: Fix bugprone-implicit-widening-of-multiplication-result

For example:

```
/usr/bin/clang-tidy -checks=-*, bugprone-implicit-widening-of-multiplication-result -export-fixes /tmp/tmpppty3tdm/tmpod_qxcie.yaml -p=build /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/test-config-parse-logsize.c
../test/test-config-parse-logsize.c:24:11: error: performing an implicit widening conversion to type 'size_t' (aka 'unsigned long') of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result,-warnings-as-errors]
{ "4k", 4 * 1024, 0 },
^
```

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I571983c6381fad7a14fb179108d14220f5dfdeca

show more ...

a72711af18-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

obmc-console: Add clang-format configuration

And apply the formatting.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I75251051affa5129c8698185baf8d151302b19d6

4f79c0a118-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

test: test-config-parse-logsize: Don't print size uninitialised

```
[15/34] Compiling C object test/test-config-parse-logsize.p/test-config-parse-logsize.c.o
../../../test/test-config-parse-logsize.

test: test-config-parse-logsize: Don't print size uninitialised

```
[15/34] Compiling C object test/test-config-parse-logsize.p/test-config-parse-logsize.c.o
../../../test/test-config-parse-logsize.c:53:4: warning: 6th function call argument is an uninitialized value [core.CallAndMessage]
warn("[%zu] Str %s expected size %lu rc %d,"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: If2815404f76e9c8e6b9b5c55abb78a102a808c03

show more ...

d0a8556717-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

obmc-console: Convert build to meson

The project is seeing some activity recently, so let's align it with the
desires here:

https://gerrit.openbmc.org/c/openbmc/docs/+/47732

Signed-off-by: Andrew

obmc-console: Convert build to meson

The project is seeing some activity recently, so let's align it with the
desires here:

https://gerrit.openbmc.org/c/openbmc/docs/+/47732

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I96941365440c9c164d222b4d18e6a57409819308

show more ...

d30d757318-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

config: Remove use of %m sscanf format specifier

The %m format specifier isn't defined by the C standards and so produces
an error under CFLAGS=`-pedantic -Werror`.

Signed-off-by: Andrew Jeffery <a

config: Remove use of %m sscanf format specifier

The %m format specifier isn't defined by the C standards and so produces
an error under CFLAGS=`-pedantic -Werror`.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I7fd818582472ced3f8e6adc2ea5d545b5b7dc020

show more ...

8f548f6c17-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

obmc-console: Clean up invalid sign comparisons

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I83fae6857620ca2913952bea597c1299dd962620

71e7a24912-Feb-2020 Andrew Jeffery <andrew@aj.id.au>

console-client: Enable use of a configuration file

However, only initialise a config if the option was provided. This
avoids searching for the default config, which may not exist and is
intended for

console-client: Enable use of a configuration file

However, only initialise a config if the option was provided. This
avoids searching for the default config, which may not exist and is
intended for the server.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I08f736243c1843bfb8855f5ceb69418d59a8775a

show more ...

5e7c078609-Feb-2020 Andrew Jeffery <andrew@aj.id.au>

console-socket: Add an optional component to UNIX socket abstract names

Allows multiple instances of obmc-console-server to run concurrently
without interfering with each other.

Signed-off-by: Andr

console-socket: Add an optional component to UNIX socket abstract names

Allows multiple instances of obmc-console-server to run concurrently
without interfering with each other.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I7ef9c14e554c687e8d606e1eaaed82a7f1c06d98

show more ...

c5ce2cbd25-Jul-2019 Jeremy Kerr <jk@ozlabs.org>

tests: Add client escape test

Add a small testcase for the escape-parsing code.

Change-Id: I2296d1bd0b1a97b46565e56ed867dd39a159baec
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

a395a77119-Mar-2019 Johnathan Mantey <johnathanx.mantey@intel.com>

Fix a recursive header include

The test-config-parse-logfile test case recursively includes
console-server.h.

Change-Id: I699ba24ece8671a0529cae3e25e258db811d33f5
Signed-off-by: Johnathan Mantey <j

Fix a recursive header include

The test-config-parse-logfile test case recursively includes
console-server.h.

Change-Id: I699ba24ece8671a0529cae3e25e258db811d33f5
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>

show more ...

9747d63d22-Jun-2018 Kun Yi <kunyi731@gmail.com>

test: config: Add a test for config_parse_logsize.

Add a unit test that validates config_parse_logsize returns
expected values.

Tested: 'make check' passed when ran under x86_64 environment.

Chang

test: config: Add a test for config_parse_logsize.

Add a unit test that validates config_parse_logsize returns
expected values.

Tested: 'make check' passed when ran under x86_64 environment.

Change-Id: I54d9478157fab3db7c2c5879d12e719e738a1099
Signed-off-by: Kun Yi <kunyi731@gmail.com>

show more ...

c9775ce707-Feb-2017 Jeremy Kerr <jk@ozlabs.org>

server: Use ringbuffer for socket backlog

Currently, the socket handler uses a linear buffer for the backlog data;
this means we need to shift up to 128kB of data after each socket
write().

This ch

server: Use ringbuffer for socket backlog

Currently, the socket handler uses a linear buffer for the backlog data;
this means we need to shift up to 128kB of data after each socket
write().

This change introduces a single-producer-multiple-consumer ringbuffer,
to avoid the need for memmove()ing data around; we can simply update
pointers instead of shifting data.

We add this as a new file (ringbuffer.c), to make it a little more
modular. To mitigate the risk of subtle pointer arithmetic issues, we
add a set of tests too.

Change-Id: Ib7c5151d3cf1f588436f5461000b6fed22d0681c
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

show more ...

12