Files
cacti/tests/integration/PluginRealmGrantsTest.php
Thomas VincentandTheWitness 3bb7002d2d fix(plugins): report CLI install failures and apply requested realm grants (#8296)
* fix(plugins): grant existing realms for CLI allperms

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* ci(plugins): pin database images and enforce strict shell mode

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* fix(plugins): stop automatic grants after CLI setup failures

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs(changelog): defer release entries to final backlog PR

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Co-authored-by: TheWitness <thewitness@cacti.net>
2026-10-11 21:23:27 -04:00

14 lines
679 B
PHP

<?php
test('CLI --allperms grants existing realms and reports permission failures (#8290)', function () {
$process = proc_open([PHP_BINARY, '-d', 'auto_prepend_file=', __DIR__ . '/fixtures/plugin_realm_grants.php'],
[0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes);
fclose($pipes[0]);
$output = stream_get_contents($pipes[1]) . stream_get_contents($pipes[2]);
fclose($pipes[1]);
fclose($pipes[2]);
expect(proc_close($process))->toBe(0, $output);
expect($output)->toContain('"result":"passed"');
})->skip(getenv('CACTI_PLUGIN_GRANT_TEST') !== '1', 'Requires the disposable cacti_plugin_grant_test database; production functions are not stubbed.');