def test_socketfile_failure_unreadable(check_swarm, fs): fs.create_file('/tmp/unreadable', contents='', st_mode=(stat.S_IFSOCK | 0o000)) args = ('--swarm', '--connection', '/tmp/unreadable') result = check_swarm.process_args(args=args) assert check_swarm.socketfile_permissions_failure(parsed_args=result)
def test_socketfile_failure_http(check_swarm, fs): fs.create_file('/tmp/http', contents='', st_mode=(stat.S_IFSOCK | 0o000)) args = ('--swarm', '--connection', 'http://127.0.0.1') result = check_swarm.process_args(args=args) assert not check_swarm.socketfile_permissions_failure(parsed_args=result)
def test_socketfile_failure_unwriteable(check_swarm, fs): fs.create_file('/tmp/unwritable', contents='', st_mode=(stat.S_IFSOCK | 0o000)) args = ('--swarm', '--connection', '/tmp/unwritable') result = check_swarm.process_args(args=args) assert check_swarm.socketfile_permissions_failure(parsed_args=result)
def test_socketfile_failure_missing(check_swarm, fs): args = ('--swarm', '--connection', '/tmp/missing') result = check_swarm.process_args(args=args) check_swarm.socketfile_permissions_failure(parsed_args=result)
def test_socketfile_failure_filetype(check_swarm, fs): fs.create_file('/tmp/not_socket', contents='testing') args = ('--swarm', '--connection', '/tmp/not_socket') result = check_swarm.process_args(args=args) assert check_swarm.socketfile_permissions_failure(parsed_args=result)
def test_socketfile_failure_missing(check_swarm, fs): args = ('--swarm', '--connection', '/tmp/missing') result = check_swarm.process_args(args=args) check_swarm.socketfile_permissions_failure(parsed_args=result)
def test_socketfile_failure_filetype(check_swarm, fs): fs.create_file('/tmp/not_socket', contents='testing') args = ('--swarm', '--connection', '/tmp/not_socket') result = check_swarm.process_args(args=args) assert check_swarm.socketfile_permissions_failure(parsed_args=result)
def test_socketfile_failure_http(check_swarm, fs): fs.CreateFile('/tmp/http', contents='', st_mode=(stat.S_IFSOCK | 0o000)) args = ('--swarm', '--connection', 'http://127.0.0.1') result = check_swarm.process_args(args=args) assert not check_swarm.socketfile_permissions_failure(parsed_args=result)