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
1 file changed
tree: 83d66dca35990b738f40e91e09a3f84e1f06003c
  1. conf/
  2. test/
  3. .clang-format
  4. .clang-tidy
  5. .gitignore
  6. .travis.yml
  7. bootstrap.sh
  8. config.c
  9. configure.ac
  10. console-client.c
  11. console-server.c
  12. console-server.h
  13. console-socket.c
  14. LICENSE
  15. log-handler.c
  16. Makefile.am
  17. meson.build
  18. meson_options.txt
  19. OWNERS
  20. README.md
  21. ringbuffer.c
  22. socket-handler.c
  23. tty-handler.c
  24. util.c
README.md

To Build

Note: In addition to a toolchain and autoconf tools, this requires autotools-archive to be installed.

To build this project, run the following shell commands:

./bootstrap.sh
./configure ${CONFIGURE_FLAGS}
make

To fully clean the repository, run:

./bootstrap.sh clean

To Run Server

Running the server requires a serial port (e.g. /dev/ttyS0):

touch obmc-console.conf
./obmc-console-server --config obmc-console.conf ttyS0

To Connect Client

To connect to the server, simply run the client:

./obmc-console-client

To disconnect the client, use the standard ~. combination.

Underlying design

This shows how the host UART connection is abstracted within the BMC as a Unix domain socket.

               +--------------------------------------------------------------------------------------------+
               |                                                                                            |
               |       obmc-console-client      unix domain socket         obmc-console-server              |
               |                                                                                            |
               |     +---------------------+                           +------------------------+           |
               |     | client.2200.conf    |  +---------------------+  | server.ttyVUART0.conf  |           |
           +---+--+  +---------------------+  |                     |  +------------------------+  +--------+-------+
Network    | 2200 +-->                     +->+ @obmc-console.host0 +<-+                        <--+ /dev/ttyVUART0 |   UARTs
           +---+--+  | socket-id = "host0" |  |                     |  | socket-id = "host0"    |  +--------+-------+
               |     |                     |  +---------------------+  |                        |           |
               |     +---------------------+                           +------------------------+           |
               |                                                                                            |
               |                                                                                            |
               |                                                                                            |
               +--------------------------------------------------------------------------------------------+

This supports multiple independent consoles. The socket-id is a unique portion for the unix domain socket created by the obmc-console-server instance. The server needs to know this because it needs to know what to name the pipe; the client needs to know it as it needs to form the abstract socket name to which to connect.