Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,806 changes: 25 additions & 1,781 deletions internal/metrics/smbstatus_test.go

Large diffs are not rendered by default.

120 changes: 120 additions & 0 deletions internal/metrics/testdata/smbstatus-all1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"timestamp": "2022-04-15T18:25:15.364891+0200",
"version": "4.17.0pre1-GIT-a0f12b9c80b",
"smb_conf": "/opt/sambaTest/etc/smb.conf",
"sessions": {
"3639217376": {
"session_id": "3639217376",
"server_id": {
"pid": "69650",
"task_id": "0",
"vnn": "4294967295",
"unique_id": "10756714984493602300"
},
"uid": 1000,
"gid": 1000,
"username": "janger",
"groupname": "janger",
"remote_machine": "127.0.0.1",
"hostname": "ipv4:127.0.0.1:59944",
"session_dialect": "SMB3_11",
"encryption": {
"cipher": "",
"degree": "none"
},
"signing": {
"cipher": "AES-128-GMAC",
"degree": "partial"
}
}
},
"tcons": {
"3813255619": {
"service": "gemeinsam",
"server_id": {
"pid": "69650",
"task_id": "0",
"vnn": "4294967295",
"unique_id": "10756714984493602300"
},
"tcon_id": "3813255619",
"session_id": "3639217376",
"machine": "127.0.0.1",
"connected_at": "2022-04-15T17:30:37+0200",
"encryption": {
"cipher": "AES-128-GMAC",
"degree": "full"
},
"signing": {
"cipher": "",
"degree": "none"
}
}
},
"open_files": {
"/home/janger/testfolder/hallo": {
"service_path": "/home/janger/testfolder",
"filename": "hallo",
"fileid": {
"devid": 59,
"inode": 11404245,
"extid": 0
},
"num_pending_deletes": 0,
"opens": {
"56839/2": {
"server_id": {
"pid": "69650",
"task_id": "0",
"vnn": "4294967295",
"unique_id": "10756714984493602300"
},
"uid": 1000,
"share_file_id": "2",
"sharemode": {
"hex": "0x00000003",
"NONE": false,
"READ": true,
"WRITE": true,
"DELETE": false,
"text": "RW"
},
"access_mask": {
"hex": "0x00000003",
"READ_DATA": true,
"WRITE_DATA": true,
"APPEND_DATA": false,
"READ_EA": false,
"WRITE_EA": false,
"EXECUTE": false,
"READ_ATTRIBUTES": false,
"WRITE_ATTRIBUTES": false,
"DELETE_CHILD": false,
"DELETE": false,
"READ_CONTROL": false,
"WRITE_DAC": false,
"SYNCHRONIZE": false,
"ACCESS_SYSTEM_SECURITY": false,
"text": "RW"
},
"caching": {
"READ": false,
"WRITE": false,
"HANDLE": false,
"hex": "0x00000000",
"text": ""
},
"oplock": {
"EXCLUSIVE": false,
"BATCH": false,
"LEVEL_II": false,
"LEASE": false,
"text": "NONE"
},
"lease": {},
"connected_at": "2022-04-15T17:30:38+0200"
}
}
}
}
}
180 changes: 180 additions & 0 deletions internal/metrics/testdata/smbstatus-all2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{
"timestamp": "2022-07-20T12:07:36.225955+0000",
"version": "4.17.0pre1-UNKNOWN",
"smb_conf": "/etc/samba/smb.conf",
"sessions": {},
"tcons": {
"348413079": {
"service": "IPC$",
"server_id": {
"pid": "101",
"task_id": "0",
"vnn": "4294967295",
"unique_id": "7364797719700910696"
},
"tcon_id": "348413079",
"session_id": "674813472",
"machine": "127.0.0.1",
"connected_at": "2022-07-20T12:04:15+0000",
"encryption": {
"cipher": "",
"degree": "none"
},
"signing": {
"cipher": "",
"degree": "none"
}
},
"1698398697": {
"service": "samba-share",
"server_id": {
"pid": "101",
"task_id": "0",
"vnn": "4294967295",
"unique_id": "7364797719700910696"
},
"tcon_id": "1698398697",
"session_id": "674813472",
"machine": "127.0.0.1",
"connected_at": "2022-07-20T12:04:15+0000",
"encryption": {
"cipher": "",
"degree": "none"
},
"signing": {
"cipher": "",
"degree": "none"
}
}
},
"open_files": {
"/mnt/96dd85fd-6c60-409c-bc1c-15f98eb358ee/a/y": {
"service_path": "/mnt/96dd85fd-6c60-409c-bc1c-15f98eb358ee",
"filename": "a/y",
"fileid": {
"devid": -397762331,
"inode": 13631494,
"extid": 0
},
"num_pending_deletes": 0,
"opens": {
"101/61": {
"server_id": {
"pid": "101",
"task_id": "0",
"vnn": "4294967295",
"unique_id": "7364797719700910696"
},
"uid": 1000,
"share_file_id": "61",
"sharemode": {
"hex": "0x00000007",
"NONE": false,
"READ": true,
"WRITE": true,
"DELETE": true,
"text": "RWD"
},
"access_mask": {
"hex": "0x0012019f",
"READ_DATA": true,
"WRITE_DATA": true,
"APPEND_DATA": true,
"READ_EA": true,
"WRITE_EA": true,
"EXECUTE": false,
"READ_ATTRIBUTES": true,
"WRITE_ATTRIBUTES": true,
"DELETE_CHILD": false,
"DELETE": false,
"READ_CONTROL": true,
"WRITE_DAC": false,
"SYNCHRONIZE": true,
"ACCESS_SYSTEM_SECURITY": false,
"text": "RW"
},
"caching": {
"READ": true,
"WRITE": true,
"HANDLE": true,
"hex": "0x00000007",
"text": "RWH"
},
"oplock": {
"EXCLUSIVE": false,
"BATCH": true,
"LEVEL_II": false,
"LEASE": false,
"text": "BATCH"
},
"lease": {},
"connected_at": "2022-07-20T12:06:29+0000"
}
}
},
"/mnt/96dd85fd-6c60-409c-bc1c-15f98eb358ee/a/x": {
"service_path": "/mnt/96dd85fd-6c60-409c-bc1c-15f98eb358ee",
"filename": "a/x",
"fileid": {
"devid": -397762331,
"inode": 13631493,
"extid": 0
},
"num_pending_deletes": 0,
"opens": {
"101/65": {
"server_id": {
"pid": "101",
"task_id": "0",
"vnn": "4294967295",
"unique_id": "7364797719700910696"
},
"uid": 1000,
"share_file_id": "65",
"sharemode": {
"hex": "0x00000007",
"NONE": false,
"READ": true,
"WRITE": true,
"DELETE": true,
"text": "RWD"
},
"access_mask": {
"hex": "0x0012019f",
"READ_DATA": true,
"WRITE_DATA": true,
"APPEND_DATA": true,
"READ_EA": true,
"WRITE_EA": true,
"EXECUTE": false,
"READ_ATTRIBUTES": true,
"WRITE_ATTRIBUTES": true,
"DELETE_CHILD": false,
"DELETE": false,
"READ_CONTROL": true,
"WRITE_DAC": false,
"SYNCHRONIZE": true,
"ACCESS_SYSTEM_SECURITY": false,
"text": "RW"
},
"caching": {
"READ": true,
"WRITE": true,
"HANDLE": true,
"hex": "0x00000007",
"text": "RWH"
},
"oplock": {
"EXCLUSIVE": false,
"BATCH": true,
"LEVEL_II": false,
"LEASE": true,
"text": "BATCH"
},
"lease": {},
"connected_at": "2022-07-20T12:06:42+0000"
}
}
}
}
}
Loading
Loading