Run against an ext4 image; run main commands against btrfs too
This way we test both with- and without-btrfs support
This commit is contained in:
parent
a50f90b280
commit
0603e0b423
2 changed files with 113 additions and 44 deletions
27
example.sh
27
example.sh
|
@ -41,7 +41,7 @@ main() {
|
|||
$GHEE idx -v -k state -k id ./people
|
||||
|
||||
# Add more people to the table and its indices
|
||||
$GHEE ins -v ./people < ../people.json
|
||||
$GHEE ins -v ./people < ../../people.json
|
||||
|
||||
# Get all of ./people
|
||||
$GHEE get -a ./people
|
||||
|
@ -75,7 +75,7 @@ main() {
|
|||
$GHEE create -v ./direct -k blah
|
||||
|
||||
# Create people2 in one go using `create'
|
||||
$GHEE create -v ./people2 -k id < ../people.json
|
||||
$GHEE create -v ./people2 -k id < ../../people.json
|
||||
|
||||
$GHEE status ./people2
|
||||
|
||||
|
@ -111,18 +111,33 @@ btrfs() {
|
|||
$GHEE status ./pizza
|
||||
}
|
||||
|
||||
# --- Ext4 ---
|
||||
dd if=/dev/zero of=./ghee-ext4.img bs=1M count=400 1> /dev/null 2> /dev/null
|
||||
mkfs.ext4 -L ghee-ext4 ./ghee-ext4.img 1> /dev/null 2> /dev/null
|
||||
mkdir ./ext4
|
||||
sudo mount -o loop ./ghee-ext4.img ./ext4
|
||||
cd ext4
|
||||
sudo chown $OWNER:$OWNER .
|
||||
|
||||
main
|
||||
|
||||
cd ..
|
||||
sudo umount ./ext4
|
||||
|
||||
# --- BTRFS ---
|
||||
dd if=/dev/zero of=./ghee-btrfs.img bs=1024 count=114000
|
||||
mkfs.btrfs -L ghee-example --rootdir ./empty ./ghee-btrfs.img
|
||||
## Initial file hierarchy to clone
|
||||
mkdir ./empty
|
||||
|
||||
dd if=/dev/zero of=./ghee-btrfs.img bs=1M count=114 1> /dev/null 2> /dev/null
|
||||
mkfs.btrfs -L ghee-btrfs --rootdir ./empty ./ghee-btrfs.img 1> /dev/null 2> /dev/null
|
||||
mkdir ./btrfs
|
||||
sudo mount -o loop ./ghee-btrfs.img ./btrfs
|
||||
|
||||
cd ./btrfs
|
||||
|
||||
cd btrfs
|
||||
sudo chown $OWNER:$OWNER .
|
||||
|
||||
main
|
||||
|
||||
btrfs
|
||||
|
||||
|
||||
|
|
130
example_output
130
example_output
|
@ -1,3 +1,9 @@
|
|||
+ dd if=/dev/zero of=./ghee-ext4.img bs=1M count=400
|
||||
+ mkfs.ext4 -L ghee-ext4 ./ghee-ext4.img
|
||||
+ mkdir ./ext4
|
||||
+ sudo mount -o loop ./ghee-ext4.img ./ext4
|
||||
+ cd ext4
|
||||
+ sudo chown josh:josh .
|
||||
+ main
|
||||
+ mkdir people
|
||||
+ touch ./people/Sandeep ./people/Sofia ./people/Wulfrum
|
||||
|
@ -6,13 +12,13 @@
|
|||
+ /home/josh/Projects/Ghee/target/debug/ghee set -s name=Wulfrum -s id=0 -s state=CA ./people/Wulfrum
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee init -k name ./people
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee idx -v -k id ./people ./people:id
|
||||
./people/Sandeep -> ./people:id/2
|
||||
./people/Sofia -> ./people:id/1
|
||||
./people/Wulfrum -> ./people:id/0
|
||||
./people/Sandeep -> ./people:id/2
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee idx -v -k state -k id ./people
|
||||
./people/Sandeep -> ./people/:state:id/CA/2
|
||||
./people/Sofia -> ./people/:state:id/WA/1
|
||||
./people/Wulfrum -> ./people/:state:id/CA/0
|
||||
./people/Sandeep -> ./people/:state:id/CA/2
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee ins -v ./people
|
||||
Initialized ./people/Janella
|
||||
Linked ./people:id/3 -> ./people/Janella
|
||||
|
@ -24,7 +30,7 @@ Initialized ./people/Darrel
|
|||
Linked ./people:id/5 -> ./people/Darrel
|
||||
Linked ./people/:state:id/MI/5 -> ./people/Darrel
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee get -a ./people
|
||||
user.ghee.tableinfo {"key":"name","indices_abs":{"id":"/home/josh/Projects/Ghee/example/people:id","name":"/home/josh/Projects/Ghee/example/people","state,id":"/home/josh/Projects/Ghee/example/people/:state:id"}}
|
||||
user.ghee.tableinfo {"key":"name","indices_abs":{"id":"/home/josh/Projects/Ghee/example/ext4/people:id","name":"/home/josh/Projects/Ghee/example/ext4/people","state,id":"/home/josh/Projects/Ghee/example/ext4/people/:state:id"}}
|
||||
./people/Darrel user.id 5
|
||||
./people/Darrel user.name Darrel
|
||||
./people/Darrel user.state MI
|
||||
|
@ -75,44 +81,92 @@ Initialized ./people2/5
|
|||
+ mkdir ./empty
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee status ./empty
|
||||
No table found
|
||||
+ dd if=/dev/zero of=./ghee-btrfs.img bs=1024 count=114000
|
||||
114000+0 records in
|
||||
114000+0 records out
|
||||
116736000 bytes (117 MB, 111 MiB) copied, 0.822232 s, 142 MB/s
|
||||
+ mkfs.btrfs -L ghee-example --rootdir ./empty ./ghee-btrfs.img
|
||||
btrfs-progs v6.2
|
||||
See http://btrfs.wiki.kernel.org for more information.
|
||||
|
||||
NOTE: several default settings have changed in version 5.15, please make sure
|
||||
this does not affect your deployments:
|
||||
- DUP for metadata (-m dup)
|
||||
- enabled no-holes (-O no-holes)
|
||||
- enabled free-space-tree (-R free-space-tree)
|
||||
|
||||
Making image is completed.
|
||||
Label: ghee-example
|
||||
UUID: 92e8c225-f0c9-4d27-bf97-70cf4284e725
|
||||
Node size: 16384
|
||||
Sector size: 4096
|
||||
Filesystem size: 111.33MiB
|
||||
Block group profiles:
|
||||
Data: single 8.00MiB
|
||||
Metadata: DUP 32.00MiB
|
||||
System: DUP 8.00MiB
|
||||
SSD detected: no
|
||||
Zoned device: no
|
||||
Incompat features: extref, skinny-metadata, no-holes
|
||||
Runtime features: free-space-tree
|
||||
Checksum: crc32c
|
||||
Number of devices: 1
|
||||
Devices:
|
||||
ID SIZE PATH
|
||||
1 111.33MiB ./ghee-btrfs.img
|
||||
|
||||
+ cd ..
|
||||
+ sudo umount ./ext4
|
||||
+ mkdir ./empty
|
||||
+ dd if=/dev/zero of=./ghee-btrfs.img bs=1M count=114
|
||||
+ mkfs.btrfs -L ghee-btrfs --rootdir ./empty ./ghee-btrfs.img
|
||||
+ mkdir ./btrfs
|
||||
+ sudo mount -o loop ./ghee-btrfs.img ./btrfs
|
||||
+ cd ./btrfs
|
||||
+ cd btrfs
|
||||
+ sudo chown josh:josh .
|
||||
+ main
|
||||
+ mkdir people
|
||||
+ touch ./people/Sandeep ./people/Sofia ./people/Wulfrum
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee set -s name=Sandeep -s id=2 -s state=CA ./people/Sandeep
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee set -s name=Sofia -s id=1 -s state=WA ./people/Sofia
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee set -s name=Wulfrum -s id=0 -s state=CA ./people/Wulfrum
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee init -k name ./people
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee idx -v -k id ./people ./people:id
|
||||
./people/Sandeep -> ./people:id/2
|
||||
./people/Sofia -> ./people:id/1
|
||||
./people/Wulfrum -> ./people:id/0
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee idx -v -k state -k id ./people
|
||||
./people/Sandeep -> ./people/:state:id/CA/2
|
||||
./people/Sofia -> ./people/:state:id/WA/1
|
||||
./people/Wulfrum -> ./people/:state:id/CA/0
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee ins -v ./people
|
||||
Initialized ./people/Janella
|
||||
Linked ./people:id/3 -> ./people/Janella
|
||||
Linked ./people/:state:id/FL/3 -> ./people/Janella
|
||||
Initialized ./people/Lilly
|
||||
Linked ./people:id/4 -> ./people/Lilly
|
||||
Linked ./people/:state:id/NM/4 -> ./people/Lilly
|
||||
Initialized ./people/Darrel
|
||||
Linked ./people:id/5 -> ./people/Darrel
|
||||
Linked ./people/:state:id/MI/5 -> ./people/Darrel
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee get -a ./people
|
||||
user.ghee.tableinfo {"key":"name","indices_abs":{"id":"/home/josh/Projects/Ghee/example/btrfs/people:id","name":"/home/josh/Projects/Ghee/example/btrfs/people","state,id":"/home/josh/Projects/Ghee/example/btrfs/people/:state:id"}}
|
||||
./people/Darrel user.id 5
|
||||
./people/Darrel user.name Darrel
|
||||
./people/Darrel user.state MI
|
||||
./people/Janella user.id 3
|
||||
./people/Janella user.name Janella
|
||||
./people/Janella user.state FL
|
||||
./people/Lilly user.id 4
|
||||
./people/Lilly user.name Lilly
|
||||
./people/Lilly user.state NM
|
||||
./people/Sandeep user.id 2
|
||||
./people/Sandeep user.name Sandeep
|
||||
./people/Sandeep user.state CA
|
||||
./people/Sofia user.id 1
|
||||
./people/Sofia user.name Sofia
|
||||
./people/Sofia user.state WA
|
||||
./people/Wulfrum user.id 0
|
||||
./people/Wulfrum user.name Wulfrum
|
||||
./people/Wulfrum user.state CA
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee get -a -w state=CA -f name ./people
|
||||
./people/Wulfrum user.name Wulfrum
|
||||
./people/Sandeep user.name Sandeep
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee del -v ./people -w name=Sofia
|
||||
Removed ./people:id/1
|
||||
Removed ./people/Sofia
|
||||
Removed ./people/:state:id/WA/1
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee del -v ./people:id 3
|
||||
Removed ./people:id/3
|
||||
Removed ./people/Janella
|
||||
Removed ./people/:state:id/FL/3
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee del -v ./people/:state:id CA 0
|
||||
Removed ./people:id/0
|
||||
Removed ./people/Wulfrum
|
||||
Removed ./people/:state:id/CA/0
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee get -a -w state=CA -f name ./people/:state:id
|
||||
./people/:state:id/CA/2 user.name Sandeep
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee create -v ./direct -k blah
|
||||
Initialized table ./direct with key: user.blah
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee create -v ./people2 -k id
|
||||
Initialized table ./people2 with key: user.id
|
||||
Initialized ./people2/3
|
||||
Initialized ./people2/4
|
||||
Initialized ./people2/5
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee status ./people2
|
||||
+./people2
|
||||
+./people2/3
|
||||
+./people2/4
|
||||
+./people2/5
|
||||
+ mkdir ./empty
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee status ./empty
|
||||
No table found
|
||||
+ btrfs
|
||||
+ /home/josh/Projects/Ghee/target/debug/ghee status .
|
||||
No table found
|
||||
|
|
Loading…
Reference in a new issue