File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 49
49
'' ;
50
50
} ) . sandboxed ;
51
51
52
+ sudoSameConsole = ( lib . ubuntu . "23_04" {
53
+ sharedDirs = { } ;
54
+ testScript = ''
55
+ # Ensure using sudo doesn't crash the test-driver
56
+ vm.execute("sudo bash -c \"echo 'Created foo → bar.\n' >&2 && echo 'foo' \"")
57
+ '' ;
58
+ } ) . sandboxed ;
59
+
52
60
}
53
61
// package . ubuntu . images
54
62
// runTestOnEveryImage multiUserTest
Original file line number Diff line number Diff line change 57
57
systemctl mask snapd.socket
58
58
systemctl mask snapd.seeded.service
59
59
60
+ # Disable TTY usage in sudo.
61
+ # Otherwise, using sudo spawns a new pty, causing the test-driver to
62
+ # receive mixed stdout and stderr when processing command output.
63
+ # The driver only expects base64-encoded stdout, so extra stderr data
64
+ # can break the output parsing.
65
+ mkdir -p /etc/sudoers.d
66
+ cat << EOF > /etc/sudoers.d/disable-pty
67
+ Defaults !requiretty
68
+ Defaults !use_pty
69
+ EOF
70
+ visudo -cf /etc/sudoers.d/disable-pty
71
+ chmod 440 /etc/sudoers.d/disable-pty
72
+
60
73
# We have no network in the test VMs, avoid an error on bootup
61
74
systemctl mask ssh.service
62
75
systemctl mask ssh.socket
You can’t perform that action at this time.
0 commit comments