def test_zstack_creates_keys_with_secure_permissions(tdir): any_seed = b'0' * 32 stack_name = 'aStack' key_paths = get_zstack_key_paths(stack_name, tdir) ZStack.initLocalKeys(stack_name, tdir, any_seed) for file_path in key_paths['secret']: assert get_file_permission_mask(file_path) == '600' for file_path in key_paths['public']: assert get_file_permission_mask(file_path) == '644'