Skip to content

Commit 2ddaa61

Browse files
committed
MQE-1647: read vault token from local file system
1 parent 9f63033 commit 2ddaa61

File tree

1 file changed

+7
-5
lines changed
  • src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/SecretStorage

1 file changed

+7
-5
lines changed

src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/SecretStorage/VaultStorage.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ private function readVaultTokenFromFileSystem()
181181
* Get vault token helper script by parsing lines in vault config file
182182
*
183183
* @param array $lines
184-
* @return array
184+
* @return string
185185
*/
186186
private function getTokenHelperScript($lines)
187187
{
@@ -200,14 +200,16 @@ private function getTokenHelperScript($lines)
200200
*
201201
* @param string $cmd
202202
* @return string
203+
* @throws TestFrameworkException
203204
*/
204205
private function execVaultTokenHelper($cmd)
205206
{
206-
$output = '';
207207
exec($cmd, $out, $status);
208-
if ($status === 0 && isset($out[0])) {
209-
$output = $out[0];
208+
if ($status === 0 && isset($out[0]) && !empty($out[0])) {
209+
return $out[0];
210210
}
211-
return $output;
211+
throw new TestFrameworkException(
212+
'Error running custom vault token helper script. Please make sure vault CLI works in your environment.'
213+
);
212214
}
213215
}

0 commit comments

Comments
 (0)