tangled
alpha
login
or
join now
hauleth.dev
/
e9p
9
fork
atom
Pure Erlang implementation of 9p2000 protocol
filesystem
fs
9p2000
erlang
9p
9
fork
atom
overview
issues
4
pulls
pipelines
Tests for unfs module
hauleth.dev
1 month ago
26eeec84
c74dc1e5
verified
This commit was signed with the committer's
known signature
.
hauleth.dev
SSH Key Fingerprint:
SHA256:1hEP8QO8nM2KQfQ8jK4Q19y/CmqVZQI/cNSht3c1QlI=
+21
-2
1 changed file
expand all
collapse all
unified
split
test
e9p_unfs_SUITE.erl
+21
-2
test/e9p_unfs_SUITE.erl
···
6
6
-include_lib("common_test/include/ct.hrl").
7
7
8
8
all() -> [
9
9
-
can_list_mount_content
9
9
+
list_mount,
10
10
+
read_file
11
11
+
%% Ignore this test for now, as UID/GID translation is not possible
12
12
+
%% right now until we implement 9p2000.u extension
13
13
+
% write_to_existing_file
10
14
].
11
15
12
16
init_per_suite(Config) ->
···
32
36
erlang:exit(PID, normal),
33
37
Config.
34
38
35
35
-
can_list_mount_content(Config) ->
39
39
+
list_mount(Config) ->
36
40
Source = ?config(source, Config),
37
41
Mount = ?config(mount, Config),
38
42
file:write_file([Source, "/bar"], "example data"),
39
43
ct:pal(Mount),
40
44
?assertEqual(["bar"], ls(Mount)).
45
45
+
46
46
+
read_file(Config) ->
47
47
+
Source = ?config(source, Config),
48
48
+
Mount = ?config(mount, Config),
49
49
+
file:write_file([Source, "/bar"], "example data"),
50
50
+
ct:pal(Mount),
51
51
+
?assertEqual({ok, ~"example data"}, file:read_file([Mount, "/bar"])).
52
52
+
53
53
+
write_to_existing_file(Config) ->
54
54
+
Source = ?config(source, Config),
55
55
+
Mount = ?config(mount, Config),
56
56
+
file:write_file([Source, "/bar"], ""),
57
57
+
ct:pal(Mount),
58
58
+
ok = file:write_file([Mount, "/bar"], "another data"),
59
59
+
?assertEqual({ok, ~"another data"}, file:read_file([Source, "/bar"])).
41
60
42
61
%% Helpers
43
62