aboutsummaryrefslogtreecommitdiff
path: root/sbin/bectl/tests
Commit message (Collapse)AuthorAgeFilesLines
* Skip armv7 bectl tests on CI; they deadlock (""KSTACK_PAGES is 2").Edward Tomasz Napierala2020-09-141-0/+40
| | | | | | | | PR: 249229 Sponsored by: DARPA Notes: svn path=/head/; revision=365713
* Call atf_skip function in cleanup procedure as it also triggers zfs.ko loadingLi-Wen Hsu2020-09-071-0/+5
| | | | | | | | PR: 249055 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=365424
* Temporarily skip sbin.bectl.bectl_test.* i386 kernel in CILi-Wen Hsu2020-09-031-0/+30
| | | | | | | | | kldload zfs.ko on i386 hangs in CI Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=365291
* Temporarily skip tests panic i386 kernel in CILi-Wen Hsu2020-09-021-0/+5
| | | | | | | | | | | lib.libbe.be_create.libbe_create sbin.bectl.bectl_test.bectl_create PR: 249055 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=365271
* Skip bectl jail test if jail not installed (WITHOUT_JAIL).Olivier Cochard2020-04-291-0/+1
| | | | | | | | | Approved by: kevans Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D24613 Notes: svn path=/head/; revision=360465
* libbe(3): promote dependent clones when destroying an environmentKyle Evans2020-01-021-0/+45
| | | | | | | | | | | | | | | | | When removing a boot environment iterate over the dependents and process the snapshots by grabbing any clones. Promote the clones we found and then remove the target environment. This fixes the ability to destroy a boot environment when it has been used to spawn one or more other boot environments. PR: 242592 Submitted by: Wes Maag <jwmaag gmail com> (with changes by myself) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22953 Notes: svn path=/head/; revision=356279
* bectl(8): create non-recursive boot environmentsKyle Evans2019-06-271-0/+24
| | | | | | | | | | | | | | | bectl advertises that it has the ability to create recursive and non-recursive boot environments. This patch implements that functionality using the be_create_depth API provided by libbe. With this patch, bectl now works as bectl(8) describes in regards to creating recursive/non-recursive boot environments. Submitted by: Rob Fairbanks <rob.fx907 gmail com> (with minor changes) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20240 Notes: svn path=/head/; revision=349455
* bectl(8): Add a test for jail/unjail of numeric BE namesKyle Evans2019-05-241-4/+12
| | | | | | | | | | | | | | | | | | Fixed by r348215, bectl ujail first attempts the trivial fetch of a jid by passing the first argument to 'ujail' to jail_getid(3) in case a jid/name have been passed in instead of a BE name. For numerically named BEs, this was doing the wrong thing: instead of failing to locate the jid specified and falling back to mountpath search, jail_getid(3) would return the input as-is. While here, I've fixed bectl_jail_cleanup which still used a hard-coded pool name that was overlooked w.r.t. other work that was in-flight around the same time. MFC after: 3 days Notes: svn path=/head/; revision=348219
* libbe: Fix zfs_is_mounted check w/ snapshotsKyle Evans2019-04-011-0/+9
| | | | | | | | | | | | | | 'be_destroy' can destroy a boot environment (by name) or a given snapshot. If the target to be destroyed is a dataset, check if it's mounted. We don't want to check if the origin dataset is mounted when destroying a snapshot. PR: 236043 Submitted by: Rob Fairbanks <rob.fx907 gmail com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19650 Notes: svn path=/head/; revision=345769
* Fix up concurrent test zpool setup and teardownEnji Cooper2019-02-121-17/+34
| | | | | | | | | | | | | | | | | | Set up zpools with a more unique name, stash the zpool name away in a file pointed to by `$ZPOOL_NAME_FILE` (which is relative to a per-testcase generated temporary directory), then remove the file based on `$ZPOOL_NAME_FILE` in the cleanup routines. This is a more concurrency-safe solution and will allow the testcases to be safely executed in parallel. Reviewed by: kevans, jtl Approved by: jtl (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19024 Notes: svn path=/head/; revision=344067
* bectl(8): commit missing test modifications from r343993Kyle Evans2019-02-111-3/+3
| | | | | | | X-MFC-With: r343993 Notes: svn path=/head/; revision=343994
* bectl(8) test: Force destroy the zpool in cleanupKyle Evans2019-01-291-1/+1
| | | | | | | | | | | | | | This is a wild guess as to why bectl tests failed once upon a time in CI, given no apparent way to see a transcript of cleanup routines with Kyua. The bectl tests construct a new, clean zpool for every test. The failure indicated was because of a mount that was leftover from a previous test, but the previous test had succeeded so it's not clear how the mount remained leftover unless the `zpool get health ${pool}` had somehow failed. MFC after: 1 week Notes: svn path=/head/; revision=343543
* libbe(3): Change be_mount to mount/unmount child datasetsKyle Evans2019-01-101-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | This set of changes is geared towards making bectl respect deep boot environments when they exist and are mounted. The deep BE composition functionality (`bectl add`) remains disabled for the time being. This set of changes has no effect for the average user. but allows deep BE users to upgrade properly with their current setup. libbe(3): Open the target boot environment and get a zfs handle, then pass that with the target mountpoint to be_mount_iter; If the BE_MNT_DEEP flag is set call zfs_iter_filesystems and mount the child datasets. Similar logic is employed when unmounting the datasets, save for children are unmounted first. bectl(8): Change bectl_cmd_jail to pass the BE_MNT_DEEP flag when calling be_mount as well as call be_unmount when cleaning up after the jail has exited instead of umount(2) directly. PR: 234795 Submitted by: Wes Maag <jwmaag_gmail.com> (test additions by kevans) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18796 Notes: svn path=/head/; revision=342911
* bectl: use jail id as the default jail name for a boot environmentKyle Evans2018-12-251-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, bectl is setting the jail 'name' parameter to the boot environment name, which causes an error when the boot environment name is not a valid jail name. With the attached fix, when no name is supplied, the default jail name will be the jail id - this is is the same behavior as the jail command. Additionally, this commit addresses two other bugs that prevented unjailing in scenarios where the jail name does not match the boot environment name: 1. In 'bectl_locate_jail', 'mountpoint' is used to resolve the boot environment path, but really 'mounted' should be used. 'mountpoint' is the path where the zfs dataset will be mounted. 'mounted' is the path where the dataset is actually mounted. 2. in 'bectl_search_jail_paths', 'jail_getv' would fail after the first call. Which is fine, if the boot environment you're unjailing is the next one up. According to 'man jail_getv', it's expecting name and value strings. 'jail_getv' is being passed an integer for the lastjid, so amend that to use a string instead. Test cases have been amended to reflect the bugs found. PR: 233637 Submitted by: Rob <rob.fx907_gmail.com> MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18607 Notes: svn path=/head/; revision=342466
* bectl(8) tests: attempt to load the ZFS moduleKyle Evans2018-11-191-1/+1
| | | | | | | | | | | | | Observed in a CI test image, bectl_create test will run and be marked as skipped because the module is not loaded. The first zpool invocation will automagically load the module, but bectl_create is still skipped. Subsequent tests all pass as expected because the module is now loaded and everything is OK. MFC after: 3 days Notes: svn path=/head/; revision=340636
* bectl(8): Add some regression testsKyle Evans2018-11-192-0/+306
These tests operate on a file-backed zpool that gets created in the kyua temp dir. root and ZFS support are both required for these tests. Current tests cover create, destroy, export/import, jail, list (kind of), mount, rename, and jail. List tests should later be extended to cover formatting and the different list flags, but for now only covers basic "are create/destroy actually reflected properly" MFC after: 3 days Notes: svn path=/head/; revision=340594