b9874d0941
Add redbear-usb-storage-check in-guest binary that validates USB mass storage read and write I/O: discovers /scheme/disk/ devices, writes a test pattern to sector 2048, reads it back, verifies match, restores original content. Updates test-usb-storage-qemu.sh with write-proof verification step. Includes all accumulated Red Bear OS work: kernel patches, relibc patches, driver infrastructure, DRM/GPU, KDE recipes, firmware, validation tooling, build system hardening, and documentation.
19 lines
583 B
C
19 lines
583 B
C
#include <stdlib.h>
|
|
|
|
#include "test_helpers.h"
|
|
|
|
int main(void) {
|
|
// testing shell detection
|
|
// this means, because we don't detect if a shell actually exists but just assume it does, this test case breaks in
|
|
// environments without `sh`. I think that is a reasonable tradeoff.
|
|
// (And if there isn't a shell, system() won't work anyways)
|
|
int status = system(NULL);
|
|
printf("shell found: %i\n", status);
|
|
fflush(stdout);
|
|
ERROR_IF(system, status, == 0);
|
|
|
|
// base case
|
|
status = system("echo test of system");
|
|
ERROR_IF(system, status, == -1);
|
|
}
|