diff --git a/.github/workflows/behat.yml b/.github/workflows/behat.yml index 49e0800400..7a2726b700 100644 --- a/.github/workflows/behat.yml +++ b/.github/workflows/behat.yml @@ -124,4 +124,7 @@ jobs: run: | export BEHAT_RUN_AS=$(ls -ld behat.yml | awk '{print $3}') export BEHAT_VERBOSE="$RUNNER_DEBUG" - vendor/bin/behat -f junit -f pretty --colors + whoami + env + ls -la $BEHAT_ROOT_DIR + vendor/bin/behat -f junit -f pretty --colors features/account/signature.feature:28 diff --git a/lib/Service/InstallService.php b/lib/Service/InstallService.php index e193a8775a..c1ec34770d 100644 --- a/lib/Service/InstallService.php +++ b/lib/Service/InstallService.php @@ -92,7 +92,15 @@ public function setOutput(OutputInterface $output): void { } private function getFolder(string $path = ''): ISimpleFolder { + $this->appConfig->setAppValue('getting folder', $path); + $ls = shell_exec('ls -la data'); + $this->appConfig->setAppValue('ls -la data', $ls); + $appdata = shell_exec('ls -la data/appdata_*'); + $this->appConfig->setAppValue('ls -la data/appdata_*', $appdata); + $whoami = shell_exec('whoami'); + $this->appConfig->setAppValue('whoami', $whoami); $folder = $this->appData->getFolder('/'); + $this->appConfig->setAppValue('folder found', 'yay'); if ($path) { try { $folder = $folder->getFolder($path); @@ -485,6 +493,7 @@ public function uninstallPdftk(): void { } public function installCfssl(?bool $async = false): void { + $this->appConfig->setAppValue('start install as async', $async ? 'yes': 'no'); if ($this->certificateEngineHandler->getEngine()->getName() !== 'cfssl') { if (!$async) { throw new InvalidArgumentException('Set the engine to cfssl with: config:app:set libresign certificate_engine --value cfssl'); @@ -496,20 +505,26 @@ public function installCfssl(?bool $async = false): void { $this->runAsync(); return; } + $this->appConfig->setAppValue('OS Family', PHP_OS_FAMILY); if (PHP_OS_FAMILY !== 'Linux') { throw new RuntimeException(sprintf('OS_FAMILY %s is incompatible with LibreSign.', PHP_OS_FAMILY)); } $architecture = php_uname('m'); + $this->appConfig->setAppValue('Architecture', $architecture); if ($architecture === 'x86_64') { $this->installCfssl64(); } elseif ($architecture === 'aarch64') { $this->installCfsslArm(); + } else { + $this->appConfig->setAppValue('Invalid architecture', $architecture); + throw new RuntimeException(sprintf('Architecture %s is incompatible with LibreSign.', $architecture)); } $this->removeDownloadProgress(); } private function installCfssl64(): void { $folder = $this->getFolder(); + $this->appConfig->setAppValue('01. app defined', ''); $downloads = [ [ @@ -525,9 +540,11 @@ private function installCfssl64(): void { $checksumUrl = 'https://github.com/cloudflare/cfssl/releases/download/v' . self::CFSSL_VERSION . '/cfssl_' . self::CFSSL_VERSION . '_checksums.txt'; foreach ($downloads as $download) { $hash = $this->getHash($folder, 'cfssl', $download['file'], self::CFSSL_VERSION, $checksumUrl); + $this->appConfig->setAppValue('02. hash', $hash); $file = $folder->newFile($download['destination']); $fullPath = $this->getDataDir() . DIRECTORY_SEPARATOR . $this->getInternalPathOfFile($file); + $this->appConfig->setAppValue('03. full path', $fullPath); $this->download($baseUrl . $download['file'], $download['destination'], $fullPath, $hash, 'sha256'); diff --git a/tests/integration/features/account/signature.feature b/tests/integration/features/account/signature.feature index 2fd41a2be5..12e64bbda4 100644 --- a/tests/integration/features/account/signature.feature +++ b/tests/integration/features/account/signature.feature @@ -31,6 +31,7 @@ Feature: account/signature And as user "signer1" And run the command "config:app:set libresign certificate_engine --value cfssl" And run the command "libresign:install --cfssl" + And run the command "config:list libresign" And run the command "libresign:configure:cfssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company" And sending "post" to ocs "/apps/libresign/api/v1/account/signature" | signPassword | password | diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 341ba5ce19..9a47fb45b4 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -42,8 +42,8 @@ public static function runCommand($command): void { if (posix_getuid() !== $owner['uid']) { $fullCommand = 'runuser -u ' . $owner['name'] . ' -- ' . $fullCommand; } - $fullCommand .= ' 2>&1'; exec($fullCommand, $output); + print_r($output); } public function setOpenedEmailStorage(OpenedEmailStorage $storage): void {