Add support for z/OS#46
Conversation
|
Once we merge #47 you can rebase to get working CI |
|
This has been rebased as requested. Please let me know if you have any comments or concerns. |
|
@najohnsn this needs a rebase |
Add an implementation of NewPty for the zos platform. The other functions in console_zos.go exactly match those in console_unix.go. There is no need for ptsname/unlockpt on z/OS, so tc_zos.go looks just like the implementation for linux/solaris except for the omission of those functions. Signed-off-by: Neil Johnson <najohnsn@us.ibm.com>
The echo -n switch is not always available on z/OS, so 'echo -n' has been changed to 'printf' so that the same test pattern can be reliably produced across platforms. Same goes for the seq program, so changed the sh loop to a go loop. Signed-off-by: Neil Johnson <najohnsn@us.ibm.com>
|
Sorry... left a window where my commits were gone. Re-opening with the rebased commits. |
|
|
||
| iteration := 10 | ||
|
|
||
| cmd := exec.Command("sh", "-c", fmt.Sprintf("for x in `seq 1 %d`; do echo -n test; done", iteration)) |
There was a problem hiding this comment.
not sure what the test is covering, rather than move the loop to go..
what about just changing this command to:
for x in 1 2 3 4 5 6 7 8 9 10; do printf test; done
There was a problem hiding this comment.
Great point! That works as well. I thought it might be important to keep the number of iterations more flexible. Overall, I don't see a clear advantage of one way over the other.
| var f File | ||
| var err error | ||
| var slave string | ||
| for i := 0;; i++ { |
There was a problem hiding this comment.
If true... might want to add a comment here explaining that zos does not support creating a pseudo-terminal by opening the /dev/ptmx device
There was a problem hiding this comment.
You're absolutely right, z/OS has no /dev/ptmx device. What I would really like to do instead of this loop is use posix_openpt. I'm hoping for that function to be made available (without requiring the use CGO).
Support for z/OS is requested as part of the effort by IBM to deliver a container runtime for z/OS.
The changes enable building for zos and should not impact other platforms. Having said that, the console test file was changed to allow the test to run reliably on z/OS. Although the change to the TestConsole implementation impacts linux and solaris as well, there is no intention to change the coverage of the test.
I ran the changed console test successfully with both zos and linux.