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

Rework user commands to add to container commands #51

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions ci/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,44 @@ def test_required_terms(self):
)
self.assertEqual(output, t, msg="Bad $TERM found in container!")

def test_term_enabled(self):
env = os.environ.copy()
env["TERM"] = "dumb"
output = self.assertPyrexContainerShellPTY(
"test -t 1; echo $?",
env=env,
quiet_init=True,
)
self.assertEqual(output, "0", msg="Stdout is not a TTY")

del env["TERM"]
output = self.assertPyrexContainerShellPTY(
"test -t 1; echo $?",
env=env,
quiet_init=True,
)
self.assertEqual(output, "0", msg="Stdout is not a TTY")

def test_term_disabled(self):
env = os.environ.copy()
env["TERM"] = "dumb"
output = self.assertPyrexContainerShellCommand(
"test -t 1; echo $?",
env=env,
quiet_init=True,
capture=True,
)
self.assertEqual(output, "1", msg="Stdout is a TTY when terminal is not a TTY")

del env["TERM"]
output = self.assertPyrexContainerShellCommand(
"test -t 1; echo $?",
env=env,
quiet_init=True,
capture=True,
)
self.assertEqual(output, "1", msg="Stdout is a TTY when terminal is not a TTY")

def test_tini(self):
self.assertPyrexContainerCommand("tini --version")

Expand Down
2 changes: 1 addition & 1 deletion pyrex.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ confversion = @CONFVERSION@

# As a convenience, the name of a Pyrex provided image
# can be specified here
%image = ubuntu-18.04-${config:imagetype}
%image = ubuntu-20.04-${config:imagetype}

# As a convenience, the tag of the Pyrex provided image. Defaults to the
# Pyrex version.
Expand Down