cas: use tmpdir for tests