mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-14 20:09:49 +03:00
Add testcase for interactive shell
This commit is contained in:
parent
27f300b4d7
commit
6c110538e5
1 changed files with 32 additions and 0 deletions
32
test/test_chroot_interactive_shell.py
Normal file
32
test/test_chroot_interactive_shell.py
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
"""
|
||||||
|
Copyright 2017 Oliver Smith
|
||||||
|
|
||||||
|
This file is part of pmbootstrap.
|
||||||
|
|
||||||
|
pmbootstrap is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
pmbootstrap is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
"""
|
||||||
|
import subprocess
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
def test_chroot_interactive_shell():
|
||||||
|
"""
|
||||||
|
Open a shell with 'pmbootstrap chroot' and pass 'echo hello_world\n' as stdin.
|
||||||
|
"""
|
||||||
|
pmb_src = os.path.abspath(os.path.join(os.path.dirname(__file__) + "/.."))
|
||||||
|
os.chdir(pmb_src)
|
||||||
|
ret = subprocess.check_output(["./pmbootstrap.py", "-q", "chroot"], timeout=300,
|
||||||
|
input="echo hello_world\n", universal_newlines=True,
|
||||||
|
stderr=subprocess.STDOUT)
|
||||||
|
assert ret == "hello_world\n"
|
Loading…
Add table
Add a link
Reference in a new issue