File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -612,6 +612,11 @@ class ServerUnavailable(SMBResponseException):
612
612
_STATUS_CODE = NtStatus .STATUS_SERVER_UNAVAILABLE
613
613
614
614
615
+ class DiskFull (SMBResponseException ):
616
+ _BASE_MESSAGE = "There is not enough space on the disk."
617
+ _STATUS_CODE = NtStatus .STATUS_DISK_FULL
618
+
619
+
615
620
class ErrorContextId :
616
621
"""
617
622
[MS-SMB2] v53.0 2017-09-15
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ class NtStatus:
108
108
STATUS_DFS_UNAVAILABLE = 0xC000026D
109
109
STATUS_NOT_A_REPARSE_POINT = 0xC0000275
110
110
STATUS_SERVER_UNAVAILABLE = 0xC0000466
111
+ STATUS_DISK_FULL = 0xC000007F
111
112
112
113
113
114
class Smb2Flags :
Original file line number Diff line number Diff line change @@ -126,6 +126,21 @@ def test_throw_default_exception(self):
126
126
assert str (exc ) == exp_resp
127
127
assert exc .status == NtStatus .STATUS_INVALID_PARAMETER
128
128
129
+ def test_throw_low_disk (self ):
130
+ error_resp = SMB2ErrorResponse ()
131
+ header = self ._get_header (error_resp , NtStatus .STATUS_DISK_FULL )
132
+ try :
133
+ raise SMBResponseException (header )
134
+ except SMBResponseException as exc :
135
+ assert exc .error_details == []
136
+ exp_resp = (
137
+ "Received unexpected status from the server: There is not enough space on the disk. "
138
+ "(3221225599) STATUS_DISK_FULL: 0xc000007f"
139
+ )
140
+ assert exc .message == exp_resp
141
+ assert str (exc ) == exp_resp
142
+ assert exc .status == NtStatus .STATUS_DISK_FULL
143
+
129
144
def test_throw_exception_without_header (self ):
130
145
actual = NetworkNameDelegated ()
131
146
assert isinstance (actual , NetworkNameDelegated )
You can’t perform that action at this time.
0 commit comments