diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2015-07-23 12:32:29 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-09-14 15:49:05 +0200 |
commit | 447d32b6f572e8ba3100668cb8677c19c0085be6 (patch) | |
tree | 08b845050925ce568a2a9a317112d85fed227e05 /src | |
parent | 63fb0857378c450d9806b1a3c6bb5657f00a8ba1 (diff) | |
download | sssd-447d32b6f572e8ba3100668cb8677c19c0085be6.tar.gz sssd-447d32b6f572e8ba3100668cb8677c19c0085be6.tar.xz sssd-447d32b6f572e8ba3100668cb8677c19c0085be6.zip |
CI: Set env variable for all tabs in screen
Previously, only one tab had configured all environment variables
and current working directory was set to source directory.
It's better to open shell in "chroot" directory for troubleshooting purposes.
This patch also open pre-defined tabs with useful
directories with sssd cache, sssd log files, "chroot" directory
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/intg/.config/screenrc | 23 | ||||
-rw-r--r-- | src/tests/intg/util.py | 20 |
2 files changed, 37 insertions, 6 deletions
diff --git a/src/tests/intg/.config/screenrc b/src/tests/intg/.config/screenrc new file mode 100644 index 000000000..fe1e4248a --- /dev/null +++ b/src/tests/intg/.config/screenrc @@ -0,0 +1,23 @@ +autodetach on +defscrollback 1024 +startup_message off +nethack on +vbell off +vbell_msg " -- Bell,Bell!! -- " +multiuser off +msgminwait 0 +msgwait 10 + +defutf8 on +defencoding utf8 + +hardstatus string '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{g}]%{=b C}[ %d/%m %c ]%{W}' +hardstatus alwayslastline + +setenv LD_LIBRARY_PATH "$_LD_LIBRARY_PATH" +setenv LD_PRELOAD "$_LD_PRELOAD" + +screen -t / 0 sh -c 'cd $ROOT_DIR; exec "${SHELL:-sh}"' +screen -t /etc 1 sh -c 'cd $ROOT_DIR/etc; exec "${SHELL:-sh}"' +screen -t sssd_cache 3 sh -c 'cd $ROOT_DIR/var/lib/sss/db; exec "${SHELL:-sh}"' +screen -t sssd_log 2 sh -c 'cd $ROOT_DIR/var/log/sssd; exec "${SHELL:-sh}"' diff --git a/src/tests/intg/util.py b/src/tests/intg/util.py index 6e8f15d02..a5e01b3db 100644 --- a/src/tests/intg/util.py +++ b/src/tests/intg/util.py @@ -20,6 +20,7 @@ import re import os import subprocess +import config UNINDENT_RE = re.compile("^ +", re.MULTILINE) @@ -42,13 +43,20 @@ def run_shell(): Execute an interactive shell under "screen", preserving environment. For use as a breakpoint for debugging. """ + my_env = os.environ.copy() + my_env["ROOT_DIR"] = config.PREFIX + + # screen filter out LD_* evniroment varibles. + # Back-up them and set them later in screenrc + my_env["_LD_LIBRARY_PATH"] = os.getenv("LD_LIBRARY_PATH", "") + my_env["_LD_PRELOAD"] = os.getenv("LD_PRELOAD", "") + subprocess.call([ - "screen", "-D", "-m", "bash", "-c", - "PATH='" + os.getenv("PATH", "") + "' " + - "LD_LIBRARY_PATH='" + os.getenv("LD_LIBRARY_PATH", "") + "' " + - "LD_PRELOAD='" + os.getenv("LD_PRELOAD", "") + "' " + - "bash -i" - ]) + "screen", "-DAm", "-S", "sssd_cwrap_session", "-c", + ".config/screenrc"], + env=my_env + ) + def first_dir(*args): |