1*eda14cbcSMatt Macy--
2*eda14cbcSMatt Macy-- This file and its contents are supplied under the terms of the
3*eda14cbcSMatt Macy-- Common Development and Distribution License ("CDDL"), version 1.0.
4*eda14cbcSMatt Macy-- You may only use this file in accordance with the terms of version
5*eda14cbcSMatt Macy-- 1.0 of the CDDL.
6*eda14cbcSMatt Macy--
7*eda14cbcSMatt Macy-- A full copy of the text of the CDDL should have accompanied this
8*eda14cbcSMatt Macy-- source.  A copy of the CDDL is also available via the Internet at
9*eda14cbcSMatt Macy-- http://www.illumos.org/license/CDDL.
10*eda14cbcSMatt Macy--
11*eda14cbcSMatt Macy
12*eda14cbcSMatt Macy--
13*eda14cbcSMatt Macy-- Copyright (c) 2016, 2017 by Delphix. All rights reserved.
14*eda14cbcSMatt Macy--
15*eda14cbcSMatt Macy
16*eda14cbcSMatt Macy-- This program should be invoked as "zfs program <pool> <prog> <fs> <snap>"
17*eda14cbcSMatt Macy
18*eda14cbcSMatt Macyargs = ...
19*eda14cbcSMatt Macyargv = args["argv"]
20*eda14cbcSMatt Macyassert(zfs.sync.snapshot(argv[1] .. "@" .. argv[2]) == 0)
21*eda14cbcSMatt Macysnaps = {}
22*eda14cbcSMatt Macyfor s in zfs.list.snapshots(argv[1]) do
23*eda14cbcSMatt Macy	table.insert(snaps, s)
24*eda14cbcSMatt Macyend
25*eda14cbcSMatt Macyassert(#snaps == 1)
26*eda14cbcSMatt Macyassert(snaps[1] == (argv[1] .. "@" .. argv[2]))
27