File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,24 @@ def wallet_file(name):
78
78
self .stop_nodes ()
79
79
assert_equal (os .path .isfile (wallet_dir (self .default_wallet_name , self .wallet_data_filename )), True )
80
80
81
+ self .log .info ("Verify warning is emitted when failing to scan the wallets directory" )
82
+ if platform .system () == 'Windows' :
83
+ self .log .warning ('Skipping test involving chmod as Windows does not support it.' )
84
+ elif os .geteuid () == 0 :
85
+ self .log .warning ('Skipping test involving chmod as it requires a non-root user.' )
86
+ else :
87
+ self .start_node (0 )
88
+ with self .nodes [0 ].assert_debug_log (unexpected_msgs = ['Error scanning directory entries under' ], expected_msgs = []):
89
+ result = self .nodes [0 ].listwalletdir ()
90
+ assert_equal (result , {'wallets' : [{'name' : 'default_wallet' , 'warnings' : []}]})
91
+ os .chmod (data_dir ('wallets' ), 0 )
92
+ with self .nodes [0 ].assert_debug_log (expected_msgs = ['Error scanning directory entries under' ]):
93
+ result = self .nodes [0 ].listwalletdir ()
94
+ assert_equal (result , {'wallets' : []})
95
+ self .stop_node (0 )
96
+ # Restore permissions
97
+ os .chmod (data_dir ('wallets' ), stat .S_IRUSR | stat .S_IWUSR | stat .S_IXUSR )
98
+
81
99
# create symlink to verify wallet directory path can be referenced
82
100
# through symlink
83
101
os .mkdir (wallet_dir ('w7' ))
You can’t perform that action at this time.
0 commit comments