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
16arg = ...
17fs = arg["argv"][1]
18snap = arg["argv"][2]
19
20props = {}
21
22-- prop                        filesystem                snapshot
23props['redundant_metadata'] = {{'all',       'default'}, {nil,         nil}}
24props['sync']               = {{'standard',  'default'}, {nil,         nil}}
25props['checksum']           = {{'on',        'default'}, {nil,         nil}}
26props['dedup']              = {{'off',       'default'}, {nil,         nil}}
27props['compression']        = {{'off',       'default'}, {nil,         nil}}
28props['snapdir']            = {{'hidden',    'default'}, {nil,         nil}}
29props['aclmode']            = {{'discard',   'default'}, {nil,         nil}}
30props['aclinherit']         = {{'restricted','default'}, {nil,         nil}}
31props['copies']             = {{'1',         'default'}, {nil,         nil}}
32props['primarycache']       = {{'all',       'default'}, {'all', 'default'}}
33props['secondarycache']     = {{'all',       'default'}, {'all', 'default'}}
34props['logbias']            = {{'latency',   'default'}, {nil,         nil}}
35props['atime']              = {{'on',        'default'}, {nil,         nil}}
36props['devices']            = {{'on',        'default'}, {'on',  'default'}}
37props['exec']               = {{'on',        'default'}, {'on',  'default'}}
38props['setuid']             = {{'on',        'default'}, {'on',  'default'}}
39props['readonly']           = {{'off',       'default'}, {nil,         nil}}
40props['zoned']              = {{'off',       'default'}, {nil,         nil}}
41props['vscan']              = {{'off',       'default'}, {nil,         nil}}
42props['nbmand']             = {{'off',       'default'}, {'off', 'default'}}
43props['version']            = {{'5',               nil}, {'5',         nil}}
44props['canmount']           = {{'on',        'default'}, {nil,         nil}}
45props['mounted']            = {{nil,               nil}, {nil,         nil}}
46props['defer_destroy']      = {{nil,               nil}, {'off',       nil}}
47props['normalization']      = {{'none',            nil}, {'none',      nil}}
48props['casesensitivity']    = {{'sensitive',       nil}, {'sensitive', nil}}
49props['utf8only']           = {{'off',             nil}, {'off',       nil}}
50
51fs_fails = {}
52snap_fails = {}
53for prop, expected in pairs(props) do
54	ans, src = zfs.get_prop(fs, prop)
55	if ((ans ~= expected[1][1]) or (src ~= expected[1][2])) then
56		fs_fails[prop] = {ans, src}
57	end
58
59	ans, src = zfs.get_prop(snap, prop)
60	if ((ans ~= expected[2][1]) or (src ~= expected[2][2])) then
61		snap_fails[prop] = {ans, src}
62	end
63end
64
65return {fs_fails, snap_fails}
66