Implementation assumptions in table functional test
Is your feature request related to a problem? Please describe. The table functional test creates additional table files for its own use in testing. The problem is, that all of this code relies on an assumed definition/implementation of the table file structure.
In CFE there is only one "proper" source of loadable table files, and that is the build-time table generation tool (elf2cfetbl, or equivalent)
The "dump" function of table services also can create a table file, although I believe this uses a different file type so it cannot be directly loaded.
Describe the solution you'd like At least for the test cases where the intent is to create a "good" table file but with different content, only the table generation tool should be used for this purpose. The CMake scripts have the ability to invoke the tool to produce different/alternate versions of the same table file, so this can be used.
To produce a "bad" table file where the target is a specific header, the elf2cfetbl tool should include extra debug options to force it to create a table with a bad value in that header. For other cases of bad values where it can corrupt data more indiscriminately, then it should work across the entire header equally.
Additional context The "bad" table tests may still pass the functional tests but could pass for the wrong reason. That is, its not guaranteed they corrupted the field they were supposed to corrupt.
Requester Info Joseph Hickey, Vantage Systems, Inc.
Function that generates tables starts here in the testcase code: https://github.com/nasa/cFE/blob/37f1d28df44aa7a858555b92f0c20310a6803b9f/modules/cfe_testcase/src/tbl_content_mang_test.c#L278-L378
The main issue is that it assumes a simple OS_write(fh2, &buf, sizeof(buf.Content)) will adequately write the table file content. But it may not be that simple.