You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virt/web/tests/VirtualizationSetupExportTe...

25 lines
937 B
PHP

<?php
$root = dirname(__DIR__);
$setup = file_get_contents($root . '/app/Command/CloudSetup.php');
$cli = file_get_contents($root . '/app/Command/XCat.php');
if (!is_string($setup) || !is_string($cli)) {
throw new RuntimeException('Cannot read setup command sources.');
}
$assert = static function ($condition, string $message): void {
if (!$condition) {
throw new RuntimeException($message);
}
};
$assert(!str_contains($setup, 'exportEngineConfig')
&& !str_contains($cli, 'cloudExportConfig')
&& !str_contains($setup, 'cloud_engine_hmac')
&& !str_contains($setup, 'runtime/engine'),
'Retired Python engine configuration export remains reachable.');
$assert(!preg_match('/fileperms|fileowner|posix_geteuid|\b0?600\b|\b0?700\b/', $setup),
'Fresh database setup still audits or enforces configuration permission bits.');
echo "Clean-break setup has no engine export or permission-mode gate.\n";