Skip to content

Make envtest.sh executable and add shebang#200

Merged
mariotoffia merged 1 commit into
mariotoffia:masterfrom
0xced:envtest-executable
Sep 13, 2021
Merged

Make envtest.sh executable and add shebang#200
mariotoffia merged 1 commit into
mariotoffia:masterfrom
0xced:envtest-executable

Conversation

@0xced

@0xced 0xced commented Sep 13, 2021

Copy link
Copy Markdown
Contributor

On macOS, tests running the envtest.sh script would fail with a permission denied exception because the script is not exectuable:

System.ComponentModel.Win32Exception: Permission denied
   at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Ductus.FluentDocker.Executors.ProcessExecutor`2.Execute() in Ductus.FluentDocker/Executors/ProcessExecutor.cs:line 75
   at Ductus.FluentDocker.Tests.ProcessTests.ProcessEnvironmentTest.ProcessShallPassCustomEnvironment() in Ductus.FluentDocker.Tests/ProcessTests/ProcessEnvironmentTest.cs:line 24

Also add #!/bin/sh to avoid exec format error:

System.ComponentModel.Win32Exception: Exec format error
   at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Ductus.FluentDocker.Executors.ProcessExecutor`2.Execute() in Ductus.FluentDocker/Executors/ProcessExecutor.cs:line 75
   at Ductus.FluentDocker.Tests.ProcessTests.ProcessEnvironmentTest.ProcessShallPassCustomEnvironment() in Ductus.FluentDocker.Tests/ProcessTests/ProcessEnvironmentTest.cs:line 24
On macOS, tests running the `envtest.sh` script would fail with a permission denied exception because the script is not exectuable:
```
System.ComponentModel.Win32Exception: Permission denied
   at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Ductus.FluentDocker.Executors.ProcessExecutor`2.Execute() in Ductus.FluentDocker/Executors/ProcessExecutor.cs:line 75
   at Ductus.FluentDocker.Tests.ProcessTests.ProcessEnvironmentTest.ProcessShallPassCustomEnvironment() in Ductus.FluentDocker.Tests/ProcessTests/ProcessEnvironmentTest.cs:line 24
```

Also add `#!/bin/sh` to avoid exec format error:
```
System.ComponentModel.Win32Exception: Exec format error
   at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Ductus.FluentDocker.Executors.ProcessExecutor`2.Execute() in Ductus.FluentDocker/Executors/ProcessExecutor.cs:line 75
   at Ductus.FluentDocker.Tests.ProcessTests.ProcessEnvironmentTest.ProcessShallPassCustomEnvironment() in Ductus.FluentDocker.Tests/ProcessTests/ProcessEnvironmentTest.cs:line 24
```
@0xced 0xced force-pushed the envtest-executable branch from 1c2cbe3 to 2c33225 Compare September 13, 2021 06:36
@0xced 0xced changed the title Make envtest.sh executable Make envtest.sh executable and add shebang Sep 13, 2021
@mariotoffia

Copy link
Copy Markdown
Owner

Hi @0xced and thanks for this PR! :)

@mariotoffia mariotoffia merged commit 7cea857 into mariotoffia:master Sep 13, 2021
@0xced 0xced deleted the envtest-executable branch September 13, 2021 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants