Skip to content

Commit

Permalink
write simple e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
rinsuki committed May 3, 2024
1 parent 523c434 commit 871da81
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tests/e2e.py
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
print("Hello, world!")
import tempfile
import os
import subprocess

with tempfile.TemporaryDirectory() as tmpdir:
srcdir = os.path.join(tmpdir, 'src')
os.mkdir(srcdir)
with open(os.path.join(srcdir, 'test.txt'), 'w') as f:
f.write('Hello')
mountdir = os.path.join(tmpdir, 'mount')
os.mkdir(mountdir)
overlaydir = os.path.join(tmpdir, 'overlay')
os.mkdir(mountdir)
subprocess.run(["./mayakashi.exe", "create", "-i", srcdir, "-o", os.path.join(tmpdir, 'hello'), "-j", "2"]).check_returncode()
mounter = subprocess.Popen(["./marmounter.exe", "./hello.mar", "mountpoint=" + mountdir, "overlaydir=" + overlaydir])
try:
with open(os.path.join(mountdir, 'test.txt'), 'r') as f:
assert f.read() == 'Hello'
finally:
mounter.terminate()

0 comments on commit 871da81

Please sign in to comment.