-
Notifications
You must be signed in to change notification settings - Fork 1.2k
dmesg SYSLOG interface add tests for PRINT_CALLER optional field #2637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Note about testing for Issue: #2637 We aren't sure that the indentation output with an optional field present such as PRINTK_CALLER is correct. The alignment that results is what the dmesg code currently produces (this includes Thomas fixes from): t8ch/dmesg/tests However if you look at what is produced the output aligns under the optional field instead of what may be desired which is under the text field. We have no eixsting test to compare the output that we get to and this is what is produced by the latest dmesg code so we felt this was acceptable. If there is an issue we can always open another issue and address that separately, but otherwise the tests results seem reasonable pending your review. Thank you. |
Much appreciated! |
No problem Thomas, sending the path upstream shortly. I just wanted to get this Issue number in the patch so it is clear to all where the patch is intended for. |
One additional issue, we added tests for al the existing tests but when we picked up Thomas's latest code there was a newer test: json We ran the test and it works find with the standard input file. But for *-syslog-printk-caller tests we use input-syslog-printk-caller or other appropriate inputs that match the inputs with the existing tests but add the needed additional PRINTK_CALLER field. When we run json with our input-syslog-printk-caller we get unexpected garbled output, as it is not correctly handling the additional optional PRINTK_CALLER id field. Since the code we're running against we believe to be Thomas's latest, we wanted to ask him if the json and code for -J -F is completed and if we need to open an issue for the PRINTK_CALLER version of the json test. That would appear to need a patch to the dmesg code for -F as the json test works fine when the optional field is not present. Let us know if we should open an incident for that test and work on trying to fix the issue or if you want to handle it yourself since you have been working on the dmesg code. Since it is a new test not in the current code base and it fails with the dmesg -J -F interface when the optional PRINTK_CALLER field present, we thought it was not urgent to include it here. The tests here cover all the existing tests that are in the latest standard util-linux repository. Thank you. |
Submission to Project: util-linux Open Incident: #2637 at github.com//issues/2637 Component: util-linux/sys-utils File: dmesg.c Code level patch applied against: https://github.com/t-8ch/util-linux/ and we used his local-dmesg-tests from t8ch/dmesg/tests as we needed the numerous improvements and fixes that Thomas has made to the code. With Issue 2609 support is being added for the optional PRINTK_CALLER dmesg field that is produced by the Linux Kernel when the PRINTK_CALLER config option is set. This patch addresses testing issue with the SYSLOG interface when used on Linux Kernels with the PRINTK_CALLER config option set. Since these tests are for dmesg SYSLOG interface we are submitting in a separate issue to not conflate with the tests we will be submitting for the dmesg kmsg (standard) interface. Currently dmesg -S, the syslog interface, to dmesg already supports this optional field and produces output that includes the PRINTK_CALLER field. So on a Linux system with the PRINTK_CALLER configuration option set the output looks like: [ 520.899558] [ T3919] hub 3-3:1.0: USB hub found on a system where the PRINTK_CALLER configuration option is not set the output looks like: [ 520.899558] hub 3-3:1.0: USB hub found the additional field specifies either a Thread Id or CPU id depending on the context of the task or thread at the time the printk that added the message to the kernel ring buffer was executed. The code submitted with Issue 2609 adds support for the optional PRINTK_CALLER field for the standard /dev/ksmg dmesg interface. Karel and Thomas pointed out that we need to add appropriate tests for the dmesg package, so tests need to be added to the Issue 2609 submission to support PRINTK_CALLER field with the /dev/kmsg interface. However, we noticed that though the PRINTK_CALLER optional field is supported by the dmesg syslog interface there are no tests for that existing facility. It was pointed that we really need tests for both dmesg interaces, the dmesg syslog interface which we address here and the dmesg /dev/kmsg interface that we address in Issue 2609. It is desirable to have tests for both dmesg interfaces since they exercise slightly different paths in the dmesg code. So we provide tests here specifically for dmesg syslog interface when the Linux Kernel has PRINTK_CALLER field enabled. We make copies of the existing tests/ts/dmesg tests and tailor them to test with input that includes the optional PRINTK_CALLER field and output that expects that PRINTK_CALLER optional field will be included. By providing all the syslog-printk-caller versions of all the tests we ensure the same thorough testing of the dmesg syslog interface. For tests using the dmesg syslog interface we use the -F interface to produce reliable testing results just as the existing dmesg tests do. The -F interface is specific only to the syslog interface but that is what we are testing here. Note that using the -F interface means that the system executing the tests does not need to have the PRINTK_CALLER interface to do the testing. The files provide the correct format which is very convenient. Testing occurred on a Fedora 39 System: [echron@terramar util-linux]$ uname -a Linux terramar 6.6.4-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Dec 3 18:13:11 UTC 2023 x86_64 GNU/Linux [echron@terramar util-linux]$ cat /etc/fedora-release Fedora release 39 (Thirty Nine) The version of util-linux was from the git repository with a pull on 2023/12/09 at 10:00 AM ---------------------------- Please Note - Very Important: ---------------------------- In testing we realized we needed some fixes that we know Thomas just added so we did a remote add of https://github.com/t-8ch/util-linux/ and we used his local-dmesg-tests t8ch/dmesg/tests Picking up Thomas's fixes resolved the problems we were seeing with several of our tests. *** Please test and merge this code with Thomas's project: t8ch/dmesg/tests [echron@terramar util-linux]$ ./test_dmesg -V test_dmesg from util-linux 2.39.1003-6b081 We did the recommended make check-programs before running our programs. Tests include syslog-printk-caller versions of all existing tests: -------------------- util-linux regression tests -------------------- For development purpose only. Don't execute on production system! kernel: 6.6.4-200.fc39.x86_64 options: --srcdir=/usr/src/util-linux/pending/util-linux/tests/.. \ --builddir=/usr/src/util-linux/pending/util-linux/tests/.. dmesg: colors ... OK dmesg: colors-syslog-prtk-caller ... OK dmesg: levels ... OK dmesg: levels-syslog-prtk-caller ... OK dmesg: decode ... OK dmesg: decode-syslog-prtk-caller ... OK dmesg: delta ... OK dmesg: delta-syslog-prtk-caller ... OK dmesg: facilities ... OK dmesg: facilities-syslog-prtk-caller ... OK dmesg: indentation ... OK dmesg: indent-syslog-printk-caller ... OK dmesg: limit ... OK dmesg: limit-syslog-prtk-caller ... OK Signed-off-by: Ivan Delalande <colona@arista.com> Signed-off-by: Edward Chron <echron@arista.com>
The json version of the SYSLOG interface test has been fixed and is included in the files submitted for Issue #2609. See issue #2609 added files: A tests/ts/dmesg/json-syslog-printk-caller Those are the only syslog related files included with Issue #2609 |
Thomas Review comments:
Answer: I did notice there are some differences in a few of the cases. The kmsg tests are in Issue #2609 as is json for SYSLOG because it needed some dmesg.c code to make it work correctly. Also, I hadn't pciked up your latest json code initially so I couldn't test until I pulled it and in fact I pulled it early from your repoistory to get started on it ASAP. I was hoping the reviewers could take a look and tell me which tests if any we don't need. Also why a few of the tests give slightly different results that I don't think has anything to do with PRINTK_CALLER but maybe I'm missing something. Best to catch any issues now. I'd rather test very thoroughly and not miss any issues. The dmesg -K interface is new and I thought needs testing and honestly since PRINTK_CALLER introduces an optional field in both I wanted to make sure nothing slips by. If you run all the tests at once with tests/run.sh dmesg it runs really fast so I don't think it will slow anything down. |
Updating this patch with refreshed code that fits the dmesg test naming convention that Thomas introduced recently when added json tests. Also attaching updated patch and sending to the mailing list as well. Add dmesg syslog interface caller_id tests Issue: #2637. Submission to Project: util-linux For Issue #2609 Thomas and Zak pointed out the we need tests to verify Currently, dmesg only has standard syslog interface tests even though We would like syslog caller-id tests both to validate that the dmesg. These tests are for the dmesg syslog interface with caller-id follow the Until Thomas added a dmesg kmsg interface for json format testing For caller_id tests we prefix the test name with cid- abbreviating colors, console-levels, decode, delta, facilities, indentation, The cid versions of these test files are just prefixed with cid- Note: The cid-json output given here is not strictly correct because Additional new dmesg tests are found with Issue #2663 which add Also, Issue #2609 introduces dmesg kmsg interface caller-id tests |
Updated patch for Issue #2637: util-linux-add-dmesg-syslog-interface-caller_id_tests-Issue-2637.patch.gz Updated patch also sent to the mailing list for Issue #2637 |
Recommend you pick up the 4 patches that are a series with Issue: #2666 that has all code for Issues: 2609, 2637 and 2663 which the updated patch for 2609 and the tests and input files dmesg kmsg PRINTK_CALLER id but also the tests and input files dmesg syslog PRINTK_CALLER id and tests and input files for dmesg kmsg generic interface. |
Submission to Project: util-linux Open Incident: util-linux#2637 at github.com/util-linux/issues/2637 Component: util-linux/sys-utils Files: tests/ts/dmesg syslog interface caller-id files, tests and related expected files Testing on Fedora 39 with Linux-6.6.6 Kernel and CONFIG_PRINTK_CALLER config option set. Patch tested and generated with the latest util-linux code pulled. Retro-fitted to merge on top of the patch for Issue: util-linux#2609 For Issue util-linux#2609 Thomas and Zak pointed out the we need tests to verify that the dmesg command works correctly and to allow us to compare the results from PRINTK_CALLER id field tests provided by util-linux#2609 with the standard (syslog interface) dmesg tests. Currently, dmesg only has standard syslog interface tests even though dmesg -S the syslog interface supports the caller_id field. There are no syslog caller-id tests. We would like syslog caller-id tests both to validate that the dmesg code works correctly with the caller-id field being present and also to compare against the addition of dmesg kmsg caller_id support added by Issue util-linux#2609. These tests are for the dmesg syslog interface with caller-id follow the existing test structure for dmesg tests. The existing dmesg -F interface is used to input our test files. Until Thomas added a dmesg kmsg interface for json format testing there were no dmesg tests except the tests for the generic dmesg syslog tests. So we're naming the syslog caller-id tests to follow the test naming convention that Thomas introduced. For caller_id tests we prefix the test name with cid- abbreviating the caller_id name to keep the names short. There is no unqiue indentifier for syslog tests, so syslog tests are currently: colors, console-levels, decode, delta, facilities, indentation, limit, json The cid versions of these test files are just prefixed with cid- The patch for Issue: util-linux#2609 has the files: cid-input and cid-json and the expected file for cide-json Additional new dmesg tests are found with Issue util-linux#2663 which add standard dmesg kmsg interface tests providing equivalent tests to the existing dmesg syslog interface tests. Also, Issue util-linux#2609 introduces dmesg kmsg interface caller-id tests equivalent to the dmesg syslog interface with caller-id tests introduced here along with the necessary dmesg kmsg interface caller-id support needed to accomodate the PRINTK_CALLER id field. Just for reference, on a Linux system with the CONFIG_PRINTK_CALLER configuration option set the output from dmesg -S looks like: [ 520.899558] [ T3919] hub 3-3:1.0: USB hub found on a system where the PRINTK_CALLER configuration option is not set the output looks like: [ 520.899558] hub 3-3:1.0: USB hub found the additional field specifies either a Thread Id or CPU id depending on the context of the task or thread at the time the printk that added the message to the kernel ring buffer was executed. Signed-off-by: Ivan Delalande <colona@arista.com> Signed-off-by: Edward Chron <echron@arista.com>
Submission to Project: util-linux Open Incident: util-linux#2663 at github.com/util-linux/issues/2663 Component: util-linux/sys-utils Files: tests/ts/dmesg kmsg interface files and related expected files Testing on Fedora 39 with Linux-6.6.6 Kernel and CONFIG_PRINTK_CALLER config option set. Patch tested and generated with the latest util-linux code pulled. Revision: no caller optional fields in any of the kmsg-input entries Revision: retrofitted to apply on top of Issue: util-linux#2609 and Issue util-linux#2637 This is patch 1 of 2 (first in the series) Second patch needed to hold second binary file (git binary files issue) For issue util-linux#2609 Thomas and Zak pointed out the we need tests to verify that the dmesg command works correctly and to allow us to compare the results from PRINTK_CALLER id field tests provided by util-linux#2609 with the standard (syslog interface) dmesg tests. Except for a kmsg json test that Thomas added recently we don't have basic dmesg tests for the kmsg interface to compare results against. We added tests for the dmesg SYSLOG PRINTK_CALLER id interface so we can compare against those tests. Those tests were submitted with Issue util-linux#2637. Those tests were created before Thomas added the new dmesg kmsg test and I will rename those tests to match the naming scheme that Thomas is using for tests that are specific to syslog interface and specific to kmsg interface. Issue util-linux#2609 introduces dmesg kmsg interface support for the PRINTK_CALLER id field and provides tests to compare against the SYSLOG interface tests added by util-linux#2637. Those tests also need to renamed to be consistent Thomas's test naming scheme. Here we've created tests for the dmesg kmsg interface following the existing test structure for dmesg tests. With the addition of this set of tests, we have tests for SYSLOG and SYSLOG PRINTK_CALLER id field to compare against the kmsg and kmsg PRINTK_CALLER id field tests. Currently the only kmsg interface specific test that exists is the kmsg-file test that Thomas added to test the dmesg kmsg interface for json support. Thomas also added code for the -K file interface to process dmesg ksmg interface files for testing so we utilize that code here and add to it. The kmsg-input file is expanded to provide statements and fields to completely test the kmsg interface with tests that are equivalent to the SYSLOG interface dmesg tests. Additionally a ksmg-newlines file is added which provides kmsg format for testing with indentation. The output of the existing kmsg-file test is adjusted to match the expanded kmsg-input file. All tests follow the standard util-linux tests format used by dmesg for unit tests. Signed-off-by: Ivan Delalande <colona@arista.com> Signed-off-by: Edward Chron <echron@arista.com>
Submission to Project: util-linux Open Incident: util-linux#2663 at github.com/util-linux/issues/2663 Component: util-linux/sys-utils Files: tests/ts/dmesg kmsg interface files and related expected files Testing on Fedora 39 with Linux-6.6.6 Kernel and CONFIG_PRINTK_CALLER config option set. Patch tested and generated with the latest util-linux code pulled. Revision: no caller optional fields in any of the kmsg-input entries Revision: retrofitted to apply on top of Issue: util-linux#2609 and Issue util-linux#2637 This is patch 2 of 2 (second in the series) A second patch needed to hold 2nd binary file (git binary files issue) This patch is needed because git format does not produce correct output if two binary files are included in the same patch. So adding the second binary file in a second patch to resolve the issue. Signed-off-by: Ivan Delalande <colona@arista.com> Signed-off-by: Edward Chron <echron@arista.com>
Submission to Project: util-linux Open Incident: util-linux#2637 at github.com/util-linux/issues/2637 Component: util-linux/sys-utils Files: tests/ts/dmesg syslog interface caller-id files, tests and related expected files Testing on Fedora 39 with Linux-6.6.6 Kernel and CONFIG_PRINTK_CALLER config option set. Patch tested and generated with the latest util-linux code pulled. Retro-fitted to merge on top of the patch for Issue: util-linux#2609 For Issue util-linux#2609 Thomas and Zak pointed out the we need tests to verify that the dmesg command works correctly and to allow us to compare the results from PRINTK_CALLER id field tests provided by util-linux#2609 with the standard (syslog interface) dmesg tests. Currently, dmesg only has standard syslog interface tests even though dmesg -S the syslog interface supports the caller_id field. There are no syslog caller-id tests. We would like syslog caller-id tests both to validate that the dmesg code works correctly with the caller-id field being present and also to compare against the addition of dmesg kmsg caller_id support added by Issue util-linux#2609. These tests are for the dmesg syslog interface with caller-id follow the existing test structure for dmesg tests. The existing dmesg -F interface is used to input our test files. Until Thomas added a dmesg kmsg interface for json format testing there were no dmesg tests except the tests for the generic dmesg syslog tests. So we're naming the syslog caller-id tests to follow the test naming convention that Thomas introduced. For caller_id tests we prefix the test name with cid- abbreviating the caller_id name to keep the names short. There is no unqiue indentifier for syslog tests, so syslog tests are currently: colors, console-levels, decode, delta, facilities, indentation, limit, json The cid versions of these test files are just prefixed with cid- The patch for Issue: util-linux#2609 has the files: cid-input and cid-json and the expected file for cide-json Additional new dmesg tests are found with Issue util-linux#2663 which add standard dmesg kmsg interface tests providing equivalent tests to the existing dmesg syslog interface tests. Also, Issue util-linux#2609 introduces dmesg kmsg interface caller-id tests equivalent to the dmesg syslog interface with caller-id tests introduced here along with the necessary dmesg kmsg interface caller-id support needed to accomodate the PRINTK_CALLER id field. Just for reference, on a Linux system with the CONFIG_PRINTK_CALLER configuration option set the output from dmesg -S looks like: [ 520.899558] [ T3919] hub 3-3:1.0: USB hub found on a system where the PRINTK_CALLER configuration option is not set the output looks like: [ 520.899558] hub 3-3:1.0: USB hub found the additional field specifies either a Thread Id or CPU id depending on the context of the task or thread at the time the printk that added the message to the kernel ring buffer was executed. Signed-off-by: Ivan Delalande <colona@arista.com> Signed-off-by: Edward Chron <echron@arista.com>
Submission to Project: util-linux Open Incident: util-linux#2663 at github.com/util-linux/issues/2663 Component: util-linux/sys-utils Files: tests/ts/dmesg kmsg interface files and related expected files Testing on Fedora 39 with Linux-6.6.6 Kernel and CONFIG_PRINTK_CALLER config option set. Patch tested and generated with the latest util-linux code pulled. Revision: no caller optional fields in any of the kmsg-input entries Revision: retrofitted to apply on top of Issue: util-linux#2609 and Issue util-linux#2637 This is patch 1 of 2 (first in the series) Second patch needed to hold second binary file (git binary files issue) For issue util-linux#2609 Thomas and Zak pointed out the we need tests to verify that the dmesg command works correctly and to allow us to compare the results from PRINTK_CALLER id field tests provided by util-linux#2609 with the standard (syslog interface) dmesg tests. Except for a kmsg json test that Thomas added recently we don't have basic dmesg tests for the kmsg interface to compare results against. We added tests for the dmesg SYSLOG PRINTK_CALLER id interface so we can compare against those tests. Those tests were submitted with Issue util-linux#2637. Those tests were created before Thomas added the new dmesg kmsg test and I will rename those tests to match the naming scheme that Thomas is using for tests that are specific to syslog interface and specific to kmsg interface. Issue util-linux#2609 introduces dmesg kmsg interface support for the PRINTK_CALLER id field and provides tests to compare against the SYSLOG interface tests added by util-linux#2637. Those tests also need to renamed to be consistent Thomas's test naming scheme. Here we've created tests for the dmesg kmsg interface following the existing test structure for dmesg tests. With the addition of this set of tests, we have tests for SYSLOG and SYSLOG PRINTK_CALLER id field to compare against the kmsg and kmsg PRINTK_CALLER id field tests. Currently the only kmsg interface specific test that exists is the kmsg-file test that Thomas added to test the dmesg kmsg interface for json support. Thomas also added code for the -K file interface to process dmesg ksmg interface files for testing so we utilize that code here and add to it. The kmsg-input file is expanded to provide statements and fields to completely test the kmsg interface with tests that are equivalent to the SYSLOG interface dmesg tests. Additionally a ksmg-newlines file is added which provides kmsg format for testing with indentation. The output of the existing kmsg-file test is adjusted to match the expanded kmsg-input file. All tests follow the standard util-linux tests format used by dmesg for unit tests. Signed-off-by: Ivan Delalande <colona@arista.com> Signed-off-by: Edward Chron <echron@arista.com>
Submission to Project: util-linux Open Incident: util-linux#2663 at github.com/util-linux/issues/2663 Component: util-linux/sys-utils Files: tests/ts/dmesg kmsg interface files and related expected files Testing on Fedora 39 with Linux-6.6.6 Kernel and CONFIG_PRINTK_CALLER config option set. Patch tested and generated with the latest util-linux code pulled. Revision: no caller optional fields in any of the kmsg-input entries Revision: retrofitted to apply on top of Issue: util-linux#2609 and Issue util-linux#2637 This is patch 2 of 2 (second in the series) A second patch needed to hold 2nd binary file (git binary files issue) This patch is needed because git format does not produce correct output if two binary files are included in the same patch. So adding the second binary file in a second patch to resolve the issue. Signed-off-by: Ivan Delalande <colona@arista.com> Signed-off-by: Edward Chron <echron@arista.com>
I know everyone is busy coming back from the holidays but if you can let us know if we need to change, add or remove tests from this list we can make whatever changes are recommended. Thank you. |
Submission to Project: util-linux Open Incident: util-linux#2637 at github.com/util-linux/issues/2637 Component: util-linux/sys-utils Files: tests/ts/dmesg syslog interface caller-id files, tests and related expected files Testing on Fedora 39 with Linux-6.6.6 Kernel and CONFIG_PRINTK_CALLER config option set. Patch tested and generated with the latest util-linux code pulled. Retro-fitted to merge on top of the patch for Issue: util-linux#2609 For Issue util-linux#2609 Thomas and Zak pointed out the we need tests to verify that the dmesg command works correctly and to allow us to compare the results from PRINTK_CALLER id field tests provided by util-linux#2609 with the standard (syslog interface) dmesg tests. Currently, dmesg only has standard syslog interface tests even though dmesg -S the syslog interface supports the caller_id field. There are no syslog caller-id tests. We would like syslog caller-id tests both to validate that the dmesg code works correctly with the caller-id field being present and also to compare against the addition of dmesg kmsg caller_id support added by Issue util-linux#2609. These tests are for the dmesg syslog interface with caller-id follow the existing test structure for dmesg tests. The existing dmesg -F interface is used to input our test files. Until Thomas added a dmesg kmsg interface for json format testing there were no dmesg tests except the tests for the generic dmesg syslog tests. So we're naming the syslog caller-id tests to follow the test naming convention that Thomas introduced. For caller_id tests we prefix the test name with cid- abbreviating the caller_id name to keep the names short. There is no unqiue indentifier for syslog tests, so syslog tests are currently: colors, console-levels, decode, delta, facilities, indentation, limit, json The cid versions of these test files are just prefixed with cid- The patch for Issue: util-linux#2609 has the files: cid-input and cid-json and the expected file for cide-json Additional new dmesg tests are found with Issue util-linux#2663 which add standard dmesg kmsg interface tests providing equivalent tests to the existing dmesg syslog interface tests. Also, Issue util-linux#2609 introduces dmesg kmsg interface caller-id tests equivalent to the dmesg syslog interface with caller-id tests introduced here along with the necessary dmesg kmsg interface caller-id support needed to accomodate the PRINTK_CALLER id field. Just for reference, on a Linux system with the CONFIG_PRINTK_CALLER configuration option set the output from dmesg -S looks like: [ 520.899558] [ T3919] hub 3-3:1.0: USB hub found on a system where the PRINTK_CALLER configuration option is not set the output looks like: [ 520.899558] hub 3-3:1.0: USB hub found the additional field specifies either a Thread Id or CPU id depending on the context of the task or thread at the time the printk that added the message to the kernel ring buffer was executed. Signed-off-by: Ivan Delalande <colona@arista.com> Signed-off-by: Edward Chron <echron@arista.com>
Submission to Project: util-linux Open Incident: util-linux#2663 at github.com/util-linux/issues/2663 Component: util-linux/sys-utils Files: tests/ts/dmesg kmsg interface files and related expected files Testing on Fedora 39 with Linux-6.6.6 Kernel and CONFIG_PRINTK_CALLER config option set. Patch tested and generated with the latest util-linux code pulled. Revision: no caller optional fields in any of the kmsg-input entries Revision: retrofitted to apply on top of Issue: util-linux#2609 and Issue util-linux#2637 This is patch 1 of 2 (first in the series) Second patch needed to hold second binary file (git binary files issue) For issue util-linux#2609 Thomas and Zak pointed out the we need tests to verify that the dmesg command works correctly and to allow us to compare the results from PRINTK_CALLER id field tests provided by util-linux#2609 with the standard (syslog interface) dmesg tests. Except for a kmsg json test that Thomas added recently we don't have basic dmesg tests for the kmsg interface to compare results against. We added tests for the dmesg SYSLOG PRINTK_CALLER id interface so we can compare against those tests. Those tests were submitted with Issue util-linux#2637. Those tests were created before Thomas added the new dmesg kmsg test and I will rename those tests to match the naming scheme that Thomas is using for tests that are specific to syslog interface and specific to kmsg interface. Issue util-linux#2609 introduces dmesg kmsg interface support for the PRINTK_CALLER id field and provides tests to compare against the SYSLOG interface tests added by util-linux#2637. Those tests also need to renamed to be consistent Thomas's test naming scheme. Here we've created tests for the dmesg kmsg interface following the existing test structure for dmesg tests. With the addition of this set of tests, we have tests for SYSLOG and SYSLOG PRINTK_CALLER id field to compare against the kmsg and kmsg PRINTK_CALLER id field tests. Currently the only kmsg interface specific test that exists is the kmsg-file test that Thomas added to test the dmesg kmsg interface for json support. Thomas also added code for the -K file interface to process dmesg ksmg interface files for testing so we utilize that code here and add to it. The kmsg-input file is expanded to provide statements and fields to completely test the kmsg interface with tests that are equivalent to the SYSLOG interface dmesg tests. Additionally a ksmg-newlines file is added which provides kmsg format for testing with indentation. The output of the existing kmsg-file test is adjusted to match the expanded kmsg-input file. All tests follow the standard util-linux tests format used by dmesg for unit tests. Signed-off-by: Ivan Delalande <colona@arista.com> Signed-off-by: Edward Chron <echron@arista.com>
Submission to Project: util-linux Open Incident: util-linux#2663 at github.com/util-linux/issues/2663 Component: util-linux/sys-utils Files: tests/ts/dmesg kmsg interface files and related expected files Testing on Fedora 39 with Linux-6.6.6 Kernel and CONFIG_PRINTK_CALLER config option set. Patch tested and generated with the latest util-linux code pulled. Revision: no caller optional fields in any of the kmsg-input entries Revision: retrofitted to apply on top of Issue: util-linux#2609 and Issue util-linux#2637 This is patch 2 of 2 (second in the series) A second patch needed to hold 2nd binary file (git binary files issue) This patch is needed because git format does not produce correct output if two binary files are included in the same patch. So adding the second binary file in a second patch to resolve the issue. Signed-off-by: Ivan Delalande <colona@arista.com> Signed-off-by: Edward Chron <echron@arista.com>
For issue #2609 Thomas pointed out the we need tests to verify that the adding support for PRINTK_CALLER optional field works correctly with the dmesg /dev/kmsg interface. However, we noted that there are no existing tests for the PRINTK_CALLER optional field with the dmesg SYSLOG interface despite the fact it is already supported.
So we've created tests for the dmesg SYSLOG (dmesg -S) interface following the existing test structure for dmesg tests.
More details:
Currently dmesg -S, the syslog interface, to dmesg already supports this
optional field and produces output that includes the PRINTK_CALLER field.
So on a Linux system with the PRINTK_CALLER configuration option set the
output looks like:
on a system where the PRINTK_CALLER configuration option is not set the
output looks like:
the additional field specifies either a Thread Id or CPU id depending on
the context of the task or thread at the time the printk that added the
message to the kernel ring buffer was executed.
The code submitted with Issue 2609 adds support for the optional
PRINTK_CALLER field for the standard /dev/ksmg dmesg interface.
Karel and Thomas pointed out that we need to add appropriate tests
for the dmesg package, so tests need to be added to the Issue 2609
submission to support PRINTK_CALLER field with the /dev/kmsg interface.
However, we noticed that though the PRINTK_CALLER optional field is
supported by the dmesg syslog interface there are no tests for that
existing facility.
It was pointed that we really need tests for both dmesg interaces, the
dmesg syslog interface which we address here and the dmesg /dev/kmsg
interface that we address in Issue 2609.
It is desirable to have tests for both dmesg interfaces since they
exercise slightly different paths in the dmesg code.
So we provide tests here specifically for dmesg syslog interface when
the Linux Kernel has PRINTK_CALLER field enabled.
We make copies of the existing tests/ts/dmesg tests and tailor them to
test with input that includes the optional PRINTK_CALLER field and output
that expects that PRINTK_CALLER optional field will be included.
By providing all the syslog-printk-caller versions of all the tests
we ensure the same thorough testing of the dmesg syslog interface.
For tests using the dmesg syslog interface we use the -F interface to
produce reliable testing results just as the existing dmesg tests do.
The -F interface is specific only to the syslog interface but that is
what we are testing here.
Note that using the -F interface means that the system executing the tests
does not need to have the PRINTK_CALLER interface to do the testing. The
files provide the correct format which is very convenient.
Testing occurred on a Fedora 39 System:
[echron@terramar util-linux]$ uname -a
Linux terramar 6.6.4-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC
Sun Dec 3 18:13:11 UTC 2023 x86_64 GNU/Linux
[echron@terramar util-linux]$ cat /etc/fedora-release
Fedora release 39 (Thirty Nine)
The version of util-linux was from the git repository with a pull on
2023/12/09 at 10:00 AM
Please Note - Very Important:
In testing we realized we needed some fixes that we know Thomas just
added so we did a remote add of https://github.com/t-8ch/util-linux/
and we used his local-dmesg-tests t8ch/dmesg/tests
Picking up Thomas's fixes resolved the problems we were seeing with
several of our tests.
*** Please test and merge this code with Thomas's project:
t8ch/dmesg/tests
[echron@terramar util-linux]$ ./test_dmesg -V
test_dmesg from util-linux 2.39.1003-6b081
We did the recommended make check-programs before running our programs.
Tests include syslog-printk-caller versions of all existing tests:
-------------------- util-linux regression tests --------------------
The text was updated successfully, but these errors were encountered: