chiark / gitweb /
sort out env some more, etc.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 23 Dec 2020 14:29:22 +0000 (14:29 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 23 Dec 2020 14:29:22 +0000 (14:29 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
wdriver.rs

index 1b6829db13bbfd337be1184601a1521188edd482..611ed6e4bbb57ea6fe545a0308743021e1f4afa7 100644 (file)
@@ -216,6 +216,13 @@ fn prepare_tmpdir(opts: &Opts, current_exe: &str) -> (String, String) {
     .ok_or_else(|| anyhow!("tmp path is not UTF-8"))?
     .to_owned();
 
+  env::set_var("HOME", &abstmp);
+  for v in "http_proxy https_proxy XAUTHORITY CDPATH \
+            SSH_AGENT_PID SSH_AUTH_SOCK WINDOWID WWW_HOME".split(' ')
+  {
+    env::remove_var(v);
+  }
+
   (our_tmpdir, abstmp)
 }
 
@@ -286,6 +293,11 @@ fn prepare_xserver(cln: &cleanup_notify::Handle, abstmp: &str) {
   Box::leak(Box::new(xconn));
 }
 
+#[throws(AE)]
+fn prepare_gameserver() {
+  
+}
+
 #[throws(AE)]
 fn prepare_geckodriver(cln: &cleanup_notify::Handle) {
   const EXPECTED : &str = "Listening on 127.0.0.1:4444";
@@ -351,10 +363,14 @@ pub fn setup() -> Setup {
       .context("reinvoke via bwrap")?;
   }
 
+  eprintln!("pid = {}", nix::unistd::getpid());
+  std::thread::sleep_ms(3500);
+
   let cln = cleanup_notify::Handle::new()?;
   let (tmp, abstmp) = prepare_tmpdir(&opts, &current_exe)?;
 
   prepare_xserver(&cln, &abstmp).context("setup X server")?;
+  prepare_gameserver().context("setup game server")?;
 
   let final_hook = FinalInfoCollection;