Skip to content

Instantly share code, notes, and snippets.

View gist:16750d7d6b6e47811513e82305dabedc
From 6ad69fc57a7f8db348fc4089e6841dc063853991 Mon Sep 17 00:00:00 2001
From: ilovezfs <ilovezfs@icloud.com>
Date: Sun, 9 May 2021 04:57:52 -0700
Subject: [PATCH] macOS test changes
---
scripts/load_macos.sh | 4 +-
scripts/zfs-tests.sh | 16 +-
tests/zfs-tests/include/blkdev.shlib | 27 +++-
tests/zfs-tests/include/commands.cfg | 16 ++
View gist:1c3a04e3c47502c94c42c1927dcb67d2
joe@joes-Mac openzfs % export __ZFS_MAIN_MOUNTPOINT_DIR=/
joe@joes-Mac openzfs % sudo zpool destroy testpool2 && sudo zpool create testpool2 disk1
Volume testpool2 on disk9s1 unmounted
joe@joes-Mac openzfs % rm outf
joe@joes-Mac openzfs % sudo zfs send -R testpool@final > outf
joe@joes-Mac openzfs % cat outf | sudo zfs receive -d -F testpool2
cannot receive incremental stream: destination 'testpool2/testfs/vclone' does not exist
joe@joes-Mac openzfs % rm outf
joe@joes-Mac openzfs % sudo zfs send -R testpool@final | tee outf &>/dev/null
joe@joes-Mac openzfs % cat outf | sudo zfs receive -d -F testpool2
View gist:acb827b0821c1b45ca2ca68ef83e0825
joe@joes-Mac openzfs % sudo zfs send -R testpool@final > outf
joe@joes-Mac openzfs % cat outf | sudo zfs receive -d -F testpool2
cannot receive incremental stream: destination 'testpool2/testfs/vclone' does not exist
joe@joes-Mac openzfs % sudo zfs send -R testpool@final | tee outf &>/dev/null
joe@joes-Mac openzfs % cat outf | sudo zfs receive -d -F testpool2
Volume testpool2 on disk9s1 unmounted
joe@joes-Mac openzfs % sudo zpool destroy testpool2
Unmount successful for /Volumes/testpool2/testfs/fs1/fs2
Unmount successful for /Volumes/testpool2/testfs/fs1/fclone
Unmount successful for /Volumes/testpool2/testfs/fs1
View gist:e7292c9d6dc3ed8ad189c447a41a506d
joe@joes-Mac openzfs % sudo zpool create -O com.apple.mimic=hfs foo disk0 && sudo touch /Volumes/foo/z{1..1000}.txt && sleep 10 && for j in {1..1000}; do mdfind z$j.txt; done && ls -i /Volumes/foo && sudo zpool destroy foo > out
/Volumes/foo/z12.txt
/Volumes/foo/z13.txt
/Volumes/foo/z14.txt
/Volumes/foo/z15.txt
/Volumes/foo/z16.txt
/Volumes/foo/z17.txt
/Volumes/foo/z18.txt
/Volumes/foo/z19.txt
/Volumes/foo/z20.txt
View gist:031cd12f7d8abc01653d045aa637067a
joe@joes-Mac openzfs % for i in {1..5}; do echo "$i..."; sudo zpool create -O com.apple.mimic=hfs foo disk0 && sudo chown joe /Volumes/foo && touch /Volumes/foo/{a1.txt,a2.txt,a3.txt,a4.txt,a5.txt,a6.txt,a7.txt,a8.txt,a9.txt} && sleep 15 && mdfind a1.txt && mdfind a2.txt && mdfind a3.txt && mdfind a4.txt && mdfind a5.txt && mdfind a6.txt && mdfind a7.txt && mdfind a8.txt && mdfind a9.txt && ls -i /Volumes/foo && sudo zpool destroy foo; done
1...
/Volumes/foo/a1.txt
/Volumes/foo/a2.txt
/Volumes/foo/a3.txt
/Volumes/foo/a4.txt
/Volumes/foo/a5.txt
/Volumes/foo/a6.txt
/Volumes/foo/a7.txt
/Volumes/foo/a8.txt
View gist:c60d8bb8f3915c214ca7aed3686a60df
joe@joes-Mac openzfs % for i in {1..5}; do echo "$i..."; sudo zpool create foo disk0 && sudo chown joe /Volumes/foo && sleep 5 && touch /Volumes/foo/{a1.txt,a2.txt,a3.txt,a4.txt,a5.txt,a6.txt,a7.txt,a8.txt,a9.txt} && sudo zfs unmount foo && sudo zfs set com.apple.mimic=hfs foo && sudo zfs mount foo && sleep 15 && mdfind a1.txt && mdfind a2.txt && mdfind a3.txt && mdfind a4.txt && mdfind a5.txt && mdfind a6.txt && mdfind a7.txt && mdfind a8.txt && mdfind a9.txt && ls -i /Volumes/foo && sudo zpool destroy foo; done
1...
Volume foo on disk7s1 unmounted
224 a1.txt 226 a3.txt 228 a5.txt 230 a7.txt 232 a9.txt
225 a2.txt 227 a4.txt 229 a6.txt 231 a8.txt
Volume foo on disk7s1 unmounted
2...
Volume foo on disk7s1 unmounted
25 a1.txt 27 a3.txt 29 a5.txt 31 a7.txt 38 a9.txt
26 a2.txt 28 a4.txt 30 a6.txt 37 a8.txt
View gist:f948c6e45de5539c714be0c83f689de5
joe@joes-Mac openzfs % for i in {1..5}; do echo "$i..."; sudo zpool create foo disk0 && sudo chown joe /Volumes/foo && touch /Volumes/foo/{a1.txt,a2.txt,a3.txt,a4.txt,a5.txt,a6.txt,a7.txt,a8.txt,a9.txt} && sudo zfs unmount foo && sudo zfs set com.apple.mimic=hfs foo && sudo zfs mount foo && sleep 15 && mdfind a1.txt && mdfind a2.txt && mdfind a3.txt && mdfind a4.txt && mdfind a5.txt && mdfind a6.txt && mdfind a7.txt && mdfind a8.txt && mdfind a9.txt && ls -i /Volumes/foo && sudo zpool destroy foo; done
1...
Volume foo on disk7s1 unmounted
18446744073709551606 a1.txt 18446744073709551609 a4.txt 18446744073709551612 a7.txt
18446744073709551607 a2.txt 18446744073709551610 a5.txt 18446744073709551613 a8.txt
18446744073709551608 a3.txt 18446744073709551611 a6.txt 18446744073709551614 a9.txt
Volume foo on disk7s1 unmounted
2...
Volume foo on disk7s1 unmounted
/Volumes/foo/a1.txt
View bigsur-unmount-fail.sh
#!/bin/bash -x
sw_vers
zpool version
NUMSECTORS=1280000
mydev=`hdiutil attach -nomount ram://$NUMSECTORS`
sudo zpool create foo $mydev
sudo zfs snapshot foo@s1
sudo zfs create foo/bar
sudo zfs rollback foo@s1
View gist:36101c10e92022deb4410ebbdc2dae43
Josephs-MacBook-Pro:~ joe$ next
Tue Aug 7 09:51:15 PDT 2018
Updated Homebrew from 9f370a3 to 15c62df.
Updated 1 tap (homebrew/core).
==> Updated Formulae
composer goenv kubectx phpunit sbt
Already up-to-date.
a2ps (guessed) : 4.14 ==> 4.14
Error: Unable to get versions for a52dec
Error: Unable to get versions for aacgain
View gist:9c1bcf60c913774ffa2b5fcc6dcf88db
a2ps
a52dec
aacgain
aalib
aamath
aap
aardvark_shell_utils
abcde
abcl
abcm2ps