Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for z/OS #46

Merged
merged 2 commits into from
Apr 12, 2021
Merged

Add support for z/OS #46

merged 2 commits into from
Apr 12, 2021

Conversation

najohnsn
Copy link
Contributor

@najohnsn najohnsn commented Jan 8, 2021

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.

@estesp
Copy link
Member

estesp commented Jan 12, 2021

Once we merge #47 you can rebase to get working CI

@najohnsn
Copy link
Contributor Author

This has been rebased as requested. Please let me know if you have any comments or concerns.

@AkihiroSuda AkihiroSuda requested review from estesp and mikebrow April 7, 2021 09:43
@kolyshkin
Copy link
Contributor

@najohnsn this needs a rebase

najohnsn added 2 commits April 9, 2021 15:51
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 <[email protected]>
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 <[email protected]>
@najohnsn najohnsn closed this Apr 9, 2021
@najohnsn
Copy link
Contributor Author

najohnsn commented Apr 9, 2021

Sorry... left a window where my commits were gone. Re-opening with the rebased commits.

@najohnsn najohnsn reopened this Apr 9, 2021
@@ -69,11 +68,6 @@ func TestConsolePty(t *testing.T) {

iteration := 10

cmd := exec.Command("sh", "-c", fmt.Sprintf("for x in `seq 1 %d`; do echo -n test; done", iteration))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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++ {
Copy link
Member

@mikebrow mikebrow Apr 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp estesp merged commit 2298a9c into containerd:master Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants