]>
Commit | Line | Data |
---|---|---|
d99a0153 CW |
1 | -- |
2 | -- This file and its contents are supplied under the terms of the | |
3 | -- Common Development and Distribution License ("CDDL"), version 1.0. | |
4 | -- You may only use this file in accordance with the terms of version | |
5 | -- 1.0 of the CDDL. | |
6 | -- | |
7 | -- A full copy of the text of the CDDL should have accompanied this | |
8 | -- source. A copy of the CDDL is also available via the Internet at | |
9 | -- http://www.illumos.org/license/CDDL. | |
10 | -- | |
11 | ||
12 | -- | |
13 | -- Copyright (c) 2016 by Delphix. All rights reserved. | |
14 | -- | |
15 | ||
16 | arg = ... | |
17 | fs = arg["argv"][1] | |
18 | snap = arg["argv"][2] | |
7839c4b5 | 19 | os = arg["argv"][3] |
d99a0153 CW |
20 | |
21 | props = {} | |
22 | ||
23 | -- prop filesystem snapshot | |
24 | props['redundant_metadata'] = {{'all', 'default'}, {nil, nil}} | |
25 | props['sync'] = {{'standard', 'default'}, {nil, nil}} | |
26 | props['checksum'] = {{'on', 'default'}, {nil, nil}} | |
27 | props['dedup'] = {{'off', 'default'}, {nil, nil}} | |
28 | props['compression'] = {{'off', 'default'}, {nil, nil}} | |
29 | props['snapdir'] = {{'hidden', 'default'}, {nil, nil}} | |
7839c4b5 MM |
30 | if os == "Linux" then |
31 | props['acltype'] = {{'off', 'default'}, {'off', 'default'}} | |
32 | elseif os == "FreeBSD" then | |
33 | props['aclmode'] = {{'discard', 'default'}, {'discard', 'default'}} | |
34 | end | |
d99a0153 CW |
35 | props['aclinherit'] = {{'restricted','default'}, {nil, nil}} |
36 | props['copies'] = {{'1', 'default'}, {nil, nil}} | |
37 | props['primarycache'] = {{'all', 'default'}, {'all', 'default'}} | |
38 | props['secondarycache'] = {{'all', 'default'}, {'all', 'default'}} | |
39 | props['logbias'] = {{'latency', 'default'}, {nil, nil}} | |
40 | props['atime'] = {{'on', 'default'}, {nil, nil}} | |
41 | props['devices'] = {{'on', 'default'}, {'on', 'default'}} | |
42 | props['exec'] = {{'on', 'default'}, {'on', 'default'}} | |
43 | props['setuid'] = {{'on', 'default'}, {'on', 'default'}} | |
44 | props['readonly'] = {{'off', 'default'}, {nil, nil}} | |
7839c4b5 MM |
45 | if os == "FreeBSD" then |
46 | props['jailed'] = {{'off', 'default'}, {nil, nil}} | |
47 | else | |
48 | props['zoned'] = {{'off', 'default'}, {nil, nil}} | |
49 | end | |
d99a0153 CW |
50 | props['vscan'] = {{'off', 'default'}, {nil, nil}} |
51 | props['nbmand'] = {{'off', 'default'}, {'off', 'default'}} | |
52 | props['version'] = {{'5', nil}, {'5', nil}} | |
53 | props['canmount'] = {{'on', 'default'}, {nil, nil}} | |
54 | props['mounted'] = {{nil, nil}, {nil, nil}} | |
55 | props['defer_destroy'] = {{nil, nil}, {'off', nil}} | |
56 | props['normalization'] = {{'none', nil}, {'none', nil}} | |
57 | props['casesensitivity'] = {{'sensitive', nil}, {'sensitive', nil}} | |
58 | props['utf8only'] = {{'off', nil}, {'off', nil}} | |
59 | props['dnodesize'] = {{'legacy', 'default'}, {nil, nil}} | |
60 | props['relatime'] = {{'off', 'default'}, {nil, nil}} | |
61 | props['overlay'] = {{'off', 'default'}, {nil, nil}} | |
62 | ||
63 | fs_fails = {} | |
64 | snap_fails = {} | |
65 | for prop, expected in pairs(props) do | |
66 | ans, src = zfs.get_prop(fs, prop) | |
67 | if ((ans ~= expected[1][1]) or (src ~= expected[1][2])) then | |
68 | fs_fails[prop] = {ans, src} | |
69 | end | |
70 | ||
71 | ans, src = zfs.get_prop(snap, prop) | |
72 | if ((ans ~= expected[2][1]) or (src ~= expected[2][2])) then | |
73 | snap_fails[prop] = {ans, src} | |
74 | end | |
75 | end | |
76 | ||
77 | return {fs_fails, snap_fails} |