Skip to content

Commit

Permalink
update 0004_start_test.py - remove /32
Browse files Browse the repository at this point in the history
  • Loading branch information
Defenso-QTH committed Nov 17, 2024
1 parent b94e9b6 commit eea8fe0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/functional_tests/0004_start_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_03_create_and_start_nobridge_vnet_jail(release, jail, invoke_cli, nobri

invoke_cli([

Check failure on line 65 in tests/functional_tests/0004_start_test.py

View check run for this annotation

Cirrus CI / Build python packages

tests/functional_tests/0004_start_test.py#L65

tests.functional_tests.0004_start_test.test_03_create_and_start_nobridge_vnet_jail
Raw output
release = '14.1-RELEASE', jail = nobridge_jail
invoke_cli = <function invoke_cli.<locals>.invoke at 0x166026800180>
nobridge_jail_ip = '192.168.2.2'

    @require_root
    @require_zpool
    @require_nobridge_jail_ip
    def test_03_create_and_start_nobridge_vnet_jail(release, jail, invoke_cli, nobridge_jail_ip):
        jail = jail('nobridge_jail')
    
>       invoke_cli([
            'create', '-r', release, '-n', jail.name,
            f'ip4_addr="lo0|{nobridge_jail_ip}"', 'boot=on', 'vnet=on',
            'interfaces=vnet0:none', 'vnet_default_interface=none',
            'ip6_addr="epair0b|fe80::2/10', 'defaultrouter6=fe80::1%epair0b',
            'defaultrouter=none'
        ])

tests/functional_tests/0004_start_test.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cmd = ['iocage', 'create', '-r', '14.1-RELEASE', '-n', 'nobridge_jail', ...]
reason = 'Please provide a valid ip: Only decimal digits permitted in \'2"\' in \'192.168.2.2"\'\n'
assert_returncode = True

    def invoke(cmd, reason=None, assert_returncode=True):
        cmd.insert(0, 'iocage')
        cmd = [str(c) for c in cmd]
    
        result = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE
        )
        reason = f'{reason}: {result.stderr}' if reason else result.stderr
    
        if assert_returncode:
            # Empty or Template jails that should not be started/stopped but
            # sometimes make it in due to a race
            try:
                reason = reason.decode()
            except AttributeError:
                pass
    
            if 'execvp: /bin/sh: No such' not in reason:
>               assert result.returncode == 0, reason
E               AssertionError: Please provide a valid ip: Only decimal digits permitted in '2"' in '192.168.2.2"'
E                 
E               assert 1 == 0
E                +  where 1 = CompletedProcess(args=['iocage', 'create', '-r', '14.1-RELEASE', '-n', 'nobridge_jail', 'ip4_addr="lo0|192.168.2.2"', 'boot=on', 'vnet=on', 'interfaces=vnet0:none', 'vnet_default_interface=none', 'ip6_addr="epair0b|fe80::2/10', 'defaultrouter6=fe80::1%epair0b', 'defaultrouter=none'], returncode=1, stdout=b'', stderr=b'Please provide a valid ip: Only decimal digits permitted in \'2"\' in \'192.168.2.2"\'\n').returncode

tests/conftest.py:293: AssertionError

Check failure on line 65 in tests/functional_tests/0004_start_test.py

View check run for this annotation

Cirrus CI / Use prebuilt packages

tests/functional_tests/0004_start_test.py#L65

tests.functional_tests.0004_start_test.test_03_create_and_start_nobridge_vnet_jail
Raw output
release = '14.1-RELEASE', jail = nobridge_jail
invoke_cli = <function invoke_cli.<locals>.invoke at 0x3358182f0c20>
nobridge_jail_ip = '192.168.2.2'

    @require_root
    @require_zpool
    @require_nobridge_jail_ip
    def test_03_create_and_start_nobridge_vnet_jail(release, jail, invoke_cli, nobridge_jail_ip):
        jail = jail('nobridge_jail')
    
>       invoke_cli([
            'create', '-r', release, '-n', jail.name,
            f'ip4_addr="lo0|{nobridge_jail_ip}"', 'boot=on', 'vnet=on',
            'interfaces=vnet0:none', 'vnet_default_interface=none',
            'ip6_addr="epair0b|fe80::2/10', 'defaultrouter6=fe80::1%epair0b',
            'defaultrouter=none'
        ])

tests/functional_tests/0004_start_test.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cmd = ['iocage', 'create', '-r', '14.1-RELEASE', '-n', 'nobridge_jail', ...]
reason = 'Please provide a valid ip: Only decimal digits permitted in \'2"\' in \'192.168.2.2"\'\n'
assert_returncode = True

    def invoke(cmd, reason=None, assert_returncode=True):
        cmd.insert(0, 'iocage')
        cmd = [str(c) for c in cmd]
    
        result = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE
        )
        reason = f'{reason}: {result.stderr}' if reason else result.stderr
    
        if assert_returncode:
            # Empty or Template jails that should not be started/stopped but
            # sometimes make it in due to a race
            try:
                reason = reason.decode()
            except AttributeError:
                pass
    
            if 'execvp: /bin/sh: No such' not in reason:
>               assert result.returncode == 0, reason
E               AssertionError: Please provide a valid ip: Only decimal digits permitted in '2"' in '192.168.2.2"'
E                 
E               assert 1 == 0
E                +  where 1 = CompletedProcess(args=['iocage', 'create', '-r', '14.1-RELEASE', '-n', 'nobridge_jail', 'ip4_addr="lo0|192.168.2.2"', 'boot=on', 'vnet=on', 'interfaces=vnet0:none', 'vnet_default_interface=none', 'ip6_addr="epair0b|fe80::2/10', 'defaultrouter6=fe80::1%epair0b', 'defaultrouter=none'], returncode=1, stdout=b'', stderr=b'Please provide a valid ip: Only decimal digits permitted in \'2"\' in \'192.168.2.2"\'\n').returncode

tests/conftest.py:293: AssertionError
'create', '-r', release, '-n', jail.name,
f'ip4_addr="lo0|{nobridge_jail_ip}/32"', 'boot=on', 'vnet=on',
f'ip4_addr="lo0|{nobridge_jail_ip}"', 'boot=on', 'vnet=on',
'interfaces=vnet0:none', 'vnet_default_interface=none',
'ip6_addr="epair0b|fe80::2/10', 'defaultrouter6=fe80::1%epair0b',
'defaultrouter=none'
Expand Down

0 comments on commit eea8fe0

Please sign in to comment.