use MediaWiki\Shell\Shell;
use Wikimedia\TestingAccessWrapper;
-class FirejailCommandTest extends PHPUnit_Framework_TestCase {
+class FirejailCommandTest extends PHPUnit\Framework\TestCase {
+
+ use MediaWikiCoversValidator;
+
public function provideBuildFinalCommand() {
global $IP;
- // @codingStandardsIgnoreStart
+ // phpcs:ignore Generic.Files.LineLength
$env = "'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'";
- // @codingStandardsIgnoreEnd
$limit = "/bin/bash '$IP/includes/shell/limit.sh'";
$profile = "--profile=$IP/includes/shell/firejail.profile";
$blacklist = '--blacklist=' . realpath( MW_CONFIG_FILE );
- $default = "$blacklist --noroot --seccomp=@default --private-dev";
+ $default = "$blacklist --noroot --seccomp --private-dev";
return [
[
'No restrictions',
[
'seccomp',
'ls', Shell::SECCOMP,
- "$limit 'firejail --quiet $profile --seccomp=@default -- '\''ls'\''' $env"
+ "$limit 'firejail --quiet $profile --seccomp -- '\''ls'\''' $env"
],
[
'seccomp & no execve',
'ls', Shell::SECCOMP | Shell::NO_EXECVE,
- "$limit 'firejail --quiet $profile --shell=none --seccomp=@default,execve -- '\''ls'\''' $env"
+ "$limit 'firejail --quiet $profile --shell=none --seccomp=execve -- '\''ls'\''' $env"
],
];
}