btrfs: verify the behavior of deleting non-existing device
There is a kernel regression for btrfs, that when passing
non-existing devid to "btrfs device remove" command, kernel will
crash due to NULL pointer dereference.
The test case is for such regression, it will:
- Create and mount an empty single-device btrfs
- Try to remove devid 3, which doesn't exist for above fs
- Make sure the command exits properly with expected error message
The kernel fix is titled "btrfs: fix NULL pointer dereference when
deleting device by invalid id".
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>