# This 'global' file needs to be empty when we start dns_host_file_path = os.path.join(prefix_abs, "dns_host_file") if os.path.exists(dns_host_file_path): os.unlink(dns_host_file_path) if opts.testenv: testenv_name = os.environ.get("SELFTEST_TESTENV", testenv_default) env = switch_env(testenv_name, prefix) testenv_vars = env.get_vars() os.environ["PIDDIR"] = testenv_vars["PIDDIR"] os.environ["ENVNAME"] = testenv_name envvarstr = exported_envvars_str(testenv_vars, exported_envvars) term = os.environ.get("TERMINAL", "xterm -e") cmd = """'echo -e " Welcome to the Samba4 Test environment '%(testenv_name)' This matches the client environment used in make test server is pid `cat \$PIDDIR/samba.pid` Some useful environment variables: TORTURE_OPTIONS=\$TORTURE_OPTIONS SMB_CONF_PATH=\$SMB_CONF_PATH $envvarstr \" && LD_LIBRARY_PATH=%(LD_LIBRARY_PATH)s $(SHELL)'""" % { "testenv_name": testenv_name,
def test_vars_unknown(self): self.assertEquals("foo=1\n", exported_envvars_str({"foo": "1", "bla": "2"}, ["foo", "bar"]))
def test_no_vars(self): self.assertEquals("", exported_envvars_str({}, ["foo", "bar"]))