Mock `which sh` to reutrn `/bin/sh`.
Check for `/bin/sh` library Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
parent
71072b4beb
commit
c19788dd18
|
@ -675,17 +675,10 @@ def test_FTL_detect_aarch64_no_errors(host):
|
||||||
'''
|
'''
|
||||||
# mock uname to return aarch64 platform
|
# mock uname to return aarch64 platform
|
||||||
mock_command('uname', {'-m': ('aarch64', '0')}, host)
|
mock_command('uname', {'-m': ('aarch64', '0')}, host)
|
||||||
|
# mock `which sh` to return `/bin/sh`
|
||||||
|
mock_command('which', {'sh': ('/bin/sh', '0')}, host)
|
||||||
# mock ldd to respond with aarch64 shared library
|
# mock ldd to respond with aarch64 shared library
|
||||||
mock_command(
|
mock_command('ldd', {'/bin/sh': ('/lib/ld-linux-aarch64.so.1', '0')}, host)
|
||||||
'ldd',
|
|
||||||
{
|
|
||||||
'/bin/bash': (
|
|
||||||
'/lib/ld-linux-aarch64.so.1',
|
|
||||||
'0'
|
|
||||||
)
|
|
||||||
},
|
|
||||||
host
|
|
||||||
)
|
|
||||||
detectPlatform = host.run('''
|
detectPlatform = host.run('''
|
||||||
source /opt/pihole/basic-install.sh
|
source /opt/pihole/basic-install.sh
|
||||||
create_pihole_user
|
create_pihole_user
|
||||||
|
@ -708,8 +701,10 @@ def test_FTL_detect_armv4t_no_errors(host):
|
||||||
'''
|
'''
|
||||||
# mock uname to return armv4t platform
|
# mock uname to return armv4t platform
|
||||||
mock_command('uname', {'-m': ('armv4t', '0')}, host)
|
mock_command('uname', {'-m': ('armv4t', '0')}, host)
|
||||||
# mock ldd to respond with ld-linux shared library
|
# mock `which sh` to return `/bin/sh`
|
||||||
mock_command('ldd', {'/bin/bash': ('/lib/ld-linux.so.3', '0')}, host)
|
mock_command('which', {'sh': ('/bin/sh', '0')}, host)
|
||||||
|
# mock ldd to respond with armv4t shared library
|
||||||
|
mock_command('ldd', {'/bin/sh': ('/lib/ld-linux.so.3', '0')}, host)
|
||||||
detectPlatform = host.run('''
|
detectPlatform = host.run('''
|
||||||
source /opt/pihole/basic-install.sh
|
source /opt/pihole/basic-install.sh
|
||||||
create_pihole_user
|
create_pihole_user
|
||||||
|
@ -732,8 +727,10 @@ def test_FTL_detect_armv5te_no_errors(host):
|
||||||
'''
|
'''
|
||||||
# mock uname to return armv5te platform
|
# mock uname to return armv5te platform
|
||||||
mock_command('uname', {'-m': ('armv5te', '0')}, host)
|
mock_command('uname', {'-m': ('armv5te', '0')}, host)
|
||||||
|
# mock `which sh` to return `/bin/sh`
|
||||||
|
mock_command('which', {'sh': ('/bin/sh', '0')}, host)
|
||||||
# mock ldd to respond with ld-linux shared library
|
# mock ldd to respond with ld-linux shared library
|
||||||
mock_command('ldd', {'/bin/bash': ('/lib/ld-linux.so.3', '0')}, host)
|
mock_command('ldd', {'/bin/sh': ('/lib/ld-linux.so.3', '0')}, host)
|
||||||
detectPlatform = host.run('''
|
detectPlatform = host.run('''
|
||||||
source /opt/pihole/basic-install.sh
|
source /opt/pihole/basic-install.sh
|
||||||
create_pihole_user
|
create_pihole_user
|
||||||
|
@ -757,7 +754,9 @@ def test_FTL_detect_armv6l_no_errors(host):
|
||||||
# mock uname to return armv6l platform
|
# mock uname to return armv6l platform
|
||||||
mock_command('uname', {'-m': ('armv6l', '0')}, host)
|
mock_command('uname', {'-m': ('armv6l', '0')}, host)
|
||||||
# mock ldd to respond with ld-linux-armhf shared library
|
# mock ldd to respond with ld-linux-armhf shared library
|
||||||
mock_command('ldd', {'/bin/bash': ('/lib/ld-linux-armhf.so.3', '0')}, host)
|
# mock `which sh` to return `/bin/sh`
|
||||||
|
mock_command('which', {'sh': ('/bin/sh', '0')}, host)
|
||||||
|
mock_command('ldd', {'/bin/sh': ('/lib/ld-linux-armhf.so.3', '0')}, host)
|
||||||
detectPlatform = host.run('''
|
detectPlatform = host.run('''
|
||||||
source /opt/pihole/basic-install.sh
|
source /opt/pihole/basic-install.sh
|
||||||
create_pihole_user
|
create_pihole_user
|
||||||
|
@ -782,7 +781,9 @@ def test_FTL_detect_armv7l_no_errors(host):
|
||||||
# mock uname to return armv7l platform
|
# mock uname to return armv7l platform
|
||||||
mock_command('uname', {'-m': ('armv7l', '0')}, host)
|
mock_command('uname', {'-m': ('armv7l', '0')}, host)
|
||||||
# mock ldd to respond with ld-linux-armhf shared library
|
# mock ldd to respond with ld-linux-armhf shared library
|
||||||
mock_command('ldd', {'/bin/bash': ('/lib/ld-linux-armhf.so.3', '0')}, host)
|
# mock `which sh` to return `/bin/sh`
|
||||||
|
mock_command('which', {'sh': ('/bin/sh', '0')}, host)
|
||||||
|
mock_command('ldd', {'/bin/sh': ('/lib/ld-linux-armhf.so.3', '0')}, host)
|
||||||
detectPlatform = host.run('''
|
detectPlatform = host.run('''
|
||||||
source /opt/pihole/basic-install.sh
|
source /opt/pihole/basic-install.sh
|
||||||
create_pihole_user
|
create_pihole_user
|
||||||
|
@ -806,8 +807,10 @@ def test_FTL_detect_armv8a_no_errors(host):
|
||||||
'''
|
'''
|
||||||
# mock uname to return armv8a platform
|
# mock uname to return armv8a platform
|
||||||
mock_command('uname', {'-m': ('armv8a', '0')}, host)
|
mock_command('uname', {'-m': ('armv8a', '0')}, host)
|
||||||
|
# mock `which sh` to return `/bin/sh`
|
||||||
|
mock_command('which', {'sh': ('/bin/sh', '0')}, host)
|
||||||
# mock ldd to respond with ld-linux-armhf shared library
|
# mock ldd to respond with ld-linux-armhf shared library
|
||||||
mock_command('ldd', {'/bin/bash': ('/lib/ld-linux-armhf.so.3', '0')}, host)
|
mock_command('ldd', {'/bin/sh': ('/lib/ld-linux-armhf.so.3', '0')}, host)
|
||||||
detectPlatform = host.run('''
|
detectPlatform = host.run('''
|
||||||
source /opt/pihole/basic-install.sh
|
source /opt/pihole/basic-install.sh
|
||||||
create_pihole_user
|
create_pihole_user
|
||||||
|
@ -828,6 +831,8 @@ def test_FTL_detect_x86_64_no_errors(host):
|
||||||
'''
|
'''
|
||||||
confirms only x86_64 package is downloaded for FTL engine
|
confirms only x86_64 package is downloaded for FTL engine
|
||||||
'''
|
'''
|
||||||
|
# mock `which sh` to return `/bin/sh`
|
||||||
|
mock_command('which', {'sh': ('/bin/sh', '0')}, host)
|
||||||
detectPlatform = host.run('''
|
detectPlatform = host.run('''
|
||||||
source /opt/pihole/basic-install.sh
|
source /opt/pihole/basic-install.sh
|
||||||
create_pihole_user
|
create_pihole_user
|
||||||
|
@ -848,6 +853,8 @@ def test_FTL_detect_unknown_no_errors(host):
|
||||||
''' confirms only generic package is downloaded for FTL engine '''
|
''' confirms only generic package is downloaded for FTL engine '''
|
||||||
# mock uname to return generic platform
|
# mock uname to return generic platform
|
||||||
mock_command('uname', {'-m': ('mips', '0')}, host)
|
mock_command('uname', {'-m': ('mips', '0')}, host)
|
||||||
|
# mock `which sh` to return `/bin/sh`
|
||||||
|
mock_command('which', {'sh': ('/bin/sh', '0')}, host)
|
||||||
detectPlatform = host.run('''
|
detectPlatform = host.run('''
|
||||||
source /opt/pihole/basic-install.sh
|
source /opt/pihole/basic-install.sh
|
||||||
create_pihole_user
|
create_pihole_user
|
||||||
|
|
Loading…
Reference in New Issue