Skip to content

Cannot run tests #23

Open
Open
@pmorch

Description

@pmorch

I'm not sure why, but when I run the ./test.sh I see many diffs.

E.g. ./test.sh sed-replaces with:

sed -r 's/ctransid=[0-9]{5}/ctransid=11111/g'

but it looks like my ctransid are 6 numbers, not 5. And many more diffs.

» sudo ./test.sh 
INFO: Creating "./mytest.output"
INFO: Comparing ./example.output with ./mytest.output
--- /dev/fd/63	2025-02-28 01:16:48.216970641 +0100
+++ /dev/fd/62	2025-02-28 01:16:48.216970641 +0100
@@ -1,51 +1,30 @@
 Cleaning up temporary subvolumes.
 Create subvolume './btrfs-diff-tests'
-Create a readonly snapshot of './btrfs-diff-tests' in './btrfs-diff-tests.parent'
-Create a readonly snapshot of './btrfs-diff-tests' in './btrfs-diff-tests.child'
+Create readonly snapshot of './btrfs-diff-tests' in './btrfs-diff-tests.parent'
+Create readonly snapshot of './btrfs-diff-tests' in './btrfs-diff-tests.child'
 btrfs-snapshots-diff.py group by path output:
 =============================================
 Found a valid Btrfs stream header, version 1
 
 
 btrfs-diff-tests.child
-	snapshot: uuid=some_uuid_here, ctransid=11111, clone_uuid=some_uuid_here, clone_ctransid=11111
-
-__sub_root__
-	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
-
-__sub_root__
-	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
-
-__sub_root__
-	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
-
-__sub_root__
-	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
-
-__sub_root__
-	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
-
-__sub_root__
-	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
-
-__sub_root__
-	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
+	snapshot: uuid=some_uuid_here, ctransid=111114, clone_uuid=some_uuid_here, clone_ctransid=111111
 
 hardlink
-	renamed from "some_temporary_filename"
+	renamed from "o257-884954-0"
 
 hardlink
-	renamed from "some_temporary_filename"
-	owner 1000:1000
+	renamed from "o257-884954-0"
+	owner 0:0
 
 hardlink
-	renamed from "some_temporary_filename"
-	owner 1000:1000
+	renamed from "o257-884954-0"
+	owner 0:0
 	mode 644
 
 hardlink
-	renamed from "some_temporary_filename"
-	owner 1000:1000
+	renamed from "o257-884954-0"
+	owner 0:0
 	mode 644
 	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
 
@@ -53,116 +32,113 @@
 	link to "hardlink"
 
 dir
-	renamed from "some_temporary_filename"
+	renamed from "o258-884954-0"
 
 dir
-	renamed from "some_temporary_filename"
-	owner 1000:1000
+	renamed from "o258-884954-0"
+	owner 0:0
 
 dir
-	renamed from "some_temporary_filename"
-	owner 1000:1000
+	renamed from "o258-884954-0"
+	owner 0:0
 	mode 755
 
 dir
-	renamed from "some_temporary_filename"
-	owner 1000:1000
+	renamed from "o258-884954-0"
+	owner 0:0
 	mode 755
 	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
-some_temporary_filename
-	[18, 20] ====================
+o259-884954-0
+	[14, 16] ====================
 
 fifo
-	renamed from "some_temporary_filename"
+	renamed from "o259-884954-0"
 
 fifo
-	renamed from "some_temporary_filename"
-	owner 1000:1000
+	renamed from "o259-884954-0"
+	owner 0:0
 
 fifo
-	renamed from "some_temporary_filename"
-	owner 1000:1000
+	renamed from "o259-884954-0"
+	owner 0:0
 	mode 644
 
 fifo
-	renamed from "some_temporary_filename"
-	owner 1000:1000
+	renamed from "o259-884954-0"
+	owner 0:0
 	mode 644
 	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
 
 symlink
-	renamed from "some_temporary_filename"
+	renamed from "o260-884954-0"
 
 symlink
-	renamed from "some_temporary_filename"
-	owner 1000:1000
+	renamed from "o260-884954-0"
+	owner 0:0
 
 symlink
-	renamed from "some_temporary_filename"
-	owner 1000:1000
+	renamed from "o260-884954-0"
+	owner 0:0
 	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
 
 xxx;yyy;zzz
-	renamed from "some_temporary_filename"
+	renamed from "o261-884954-0"
 
 xxx;yyy;zzz
-	renamed from "some_temporary_filename"
+	renamed from "o261-884954-0"
 
 xxx;yyy;zzz
-	renamed from "some_temporary_filename"
+	renamed from "o261-884954-0"
 	update extents 0 -> 12
-	owner 1000:1000
+	owner 0:0
 
 xxx;yyy;zzz
-	renamed from "some_temporary_filename"
+	renamed from "o261-884954-0"
 	update extents 0 -> 12
-	owner 1000:1000
+	owner 0:0
 	mode 644
 
 xxx;yyy;zzz
-	renamed from "some_temporary_filename"
+	renamed from "o261-884954-0"
 	update extents 0 -> 12
-	owner 1000:1000
+	owner 0:0
 	mode 644
 	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
 
+__sub_root__
+	times a=YYYY/mm/dd HH:MM:SS m=YYYY/mm/dd HH:MM:SS c=YYYY/mm/dd HH:MM:SS
+
 btrfs-snapshots-diff.py CSV output:
 ===================================
-snapshot;clone_ctransid=11111;clone_uuid=some_uuid_here;ctransid=11111;path=btrfs-diff-tests.child;uuid=some_uuid_here
-utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=
-mkfile;path=some_temporary_filename
-rename;path=some_temporary_filename;path_to=hardlink
+snapshot;clone_ctransid=111111;clone_uuid=some_uuid_here;ctransid=111114;path=btrfs-diff-tests.child;uuid=some_uuid_here
+mkfile;path=o257-884954-0
+rename;path=o257-884954-0;path_to=hardlink
 link;path=file2;path_link=hardlink
-utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=
-utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=
-chown;group_id=1000;path=hardlink;user_id=1000
+chown;group_id=0;path=hardlink;user_id=0
 chmod;mode=420;path=hardlink
 utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=hardlink
-mkdir;path=some_temporary_filename
-rename;path=some_temporary_filename;path_to=dir
-utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=
-chown;group_id=1000;path=dir;user_id=1000
+mkdir;path=o258-884954-0
+rename;path=o258-884954-0;path_to=dir
+chown;group_id=0;path=dir;user_id=0
 chmod;mode=493;path=dir
 utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=dir
-mkfifo;ino=259;path=some_temporary_filename;rdev=0
-rename;path=some_temporary_filename;path_to=fifo
-utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=
-chown;group_id=1000;path=fifo;user_id=1000
+mkfifo;ino=259;path=o259-884954-0;rdev=0
+rename;path=o259-884954-0;path_to=fifo
+chown;group_id=0;path=fifo;user_id=0
 chmod;mode=420;path=fifo
 utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=fifo
 symlink;inode=260;path_link=file
-rename;path=some_temporary_filename;path_to=symlink
-utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=
-chown;group_id=1000;path=symlink;user_id=1000
+rename;path=o260-884954-0;path_to=symlink
+chown;group_id=0;path=symlink;user_id=0
 utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=symlink
-mkfile;path=some_temporary_filename
-rename;path=some_temporary_filename;path_to=xxx\;yyy\;zzz
-utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=
+mkfile;path=o261-884954-0
+rename;path=o261-884954-0;path_to=xxx\;yyy\;zzz
 update_extent;file_offset=0;path=xxx\;yyy\;zzz;size=12
-chown;group_id=1000;path=xxx\;yyy\;zzz;user_id=1000
+chown;group_id=0;path=xxx\;yyy\;zzz;user_id=0
 chmod;mode=420;path=xxx\;yyy\;zzz
 utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=xxx\;yyy\;zzz
-end;headers_length=1742;stream_length=1742
+utimes;atime=SOME.TIME;ctime=SOME.TIME;mtime=SOME.TIME;path=
+end;headers_length=1380;stream_length=1380
 
 btrfs-snapshots-diff.py JSON output:
 ====================================
@@ -171,24 +147,17 @@
     "command": "snapshot",
     "path": "btrfs-diff-tests.child",
     "uuid": "some_uuid_here",
-    "ctransid": 11111,
+    "ctransid": 111114,
     "clone_uuid": "some_uuid_here",
-    "clone_ctransid": 11111
-  },
-  {
-    "command": "utimes",
-    "path": "",
-    "atime": SOME.TIME,
-    "mtime": SOME.TIME,
-    "ctime": SOME.TIME
+    "clone_ctransid": 111111
   },
   {
     "command": "mkfile",
-    "path": "some_temporary_filename"
+    "path": "o257-884954-0"
   },
   {
     "command": "rename",
-    "path": "some_temporary_filename",
+    "path": "o257-884954-0",
     "path_to": "hardlink"
   },
   {
@@ -197,24 +166,10 @@
     "path_link": "hardlink"
   },
   {
-    "command": "utimes",
-    "path": "",
-    "atime": SOME.TIME,
-    "mtime": SOME.TIME,
-    "ctime": SOME.TIME
-  },
-  {
-    "command": "utimes",
-    "path": "",
-    "atime": SOME.TIME,
-    "mtime": SOME.TIME,
-    "ctime": SOME.TIME
-  },
-  {
     "command": "chown",
     "path": "hardlink",
-    "user_id": 1000,
-    "group_id": 1000
+    "user_id": 0,
+    "group_id": 0
   },
   {
     "command": "chmod",
@@ -230,25 +185,18 @@
   },
   {
     "command": "mkdir",
-    "path": "some_temporary_filename"
+    "path": "o258-884954-0"
   },
   {
     "command": "rename",
-    "path": "some_temporary_filename",
+    "path": "o258-884954-0",
     "path_to": "dir"
   },
   {
-    "command": "utimes",
-    "path": "",
-    "atime": SOME.TIME,
-    "mtime": SOME.TIME,
-    "ctime": SOME.TIME
-  },
-  {
     "command": "chown",
     "path": "dir",
-    "user_id": 1000,
-    "group_id": 1000
+    "user_id": 0,
+    "group_id": 0
   },
   {
     "command": "chmod",
@@ -265,26 +213,19 @@
   {
     "command": "mkfifo",
     "ino": 259,
-    "path": "some_temporary_filename",
+    "path": "o259-884954-0",
     "rdev": 0
   },
   {
     "command": "rename",
-    "path": "some_temporary_filename",
+    "path": "o259-884954-0",
     "path_to": "fifo"
   },
   {
-    "command": "utimes",
-    "path": "",
-    "atime": SOME.TIME,
-    "mtime": SOME.TIME,
-    "ctime": SOME.TIME
-  },
-  {
     "command": "chown",
     "path": "fifo",
-    "user_id": 1000,
-    "group_id": 1000
+    "user_id": 0,
+    "group_id": 0
   },
   {
     "command": "chmod",
@@ -305,21 +246,14 @@
   },
   {
     "command": "rename",
-    "path": "some_temporary_filename",
+    "path": "o260-884954-0",
     "path_to": "symlink"
   },
   {
-    "command": "utimes",
-    "path": "",
-    "atime": SOME.TIME,
-    "mtime": SOME.TIME,
-    "ctime": SOME.TIME
-  },
-  {
     "command": "chown",
     "path": "symlink",
-    "user_id": 1000,
-    "group_id": 1000
+    "user_id": 0,
+    "group_id": 0
   },
   {
     "command": "utimes",
@@ -330,21 +264,14 @@
   },
   {
     "command": "mkfile",
-    "path": "some_temporary_filename"
+    "path": "o261-884954-0"
   },
   {
     "command": "rename",
-    "path": "some_temporary_filename",
+    "path": "o261-884954-0",
     "path_to": "xxx;yyy;zzz"
   },
   {
-    "command": "utimes",
-    "path": "",
-    "atime": SOME.TIME,
-    "mtime": SOME.TIME,
-    "ctime": SOME.TIME
-  },
-  {
     "command": "update_extent",
     "path": "xxx;yyy;zzz",
     "file_offset": 0,
@@ -353,8 +280,8 @@
   {
     "command": "chown",
     "path": "xxx;yyy;zzz",
-    "user_id": 1000,
-    "group_id": 1000
+    "user_id": 0,
+    "group_id": 0
   },
   {
     "command": "chmod",
@@ -369,9 +296,16 @@
     "ctime": SOME.TIME
   },
   {
+    "command": "utimes",
+    "path": "",
+    "atime": SOME.TIME,
+    "mtime": SOME.TIME,
+    "ctime": SOME.TIME
+  },
+  {
     "command": "end",
-    "headers_length": 1742,
-    "stream_length": 1742
+    "headers_length": 1380,
+    "stream_length": 1380
   }
 ]
 
ERROR: Some tests failed. Please review ./mytest.output manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions