@@ -44,27 +44,22 @@ def test_dbus_system_configuration_file(self, bitbake_variables, connection):
4444 ).stdout .strip ()
4545 assert "io.mender.AuthenticationManager" in output
4646
47- @pytest .mark .min_mender_version ("2.5 .0" )
47+ @pytest .mark .min_mender_version ("4.0 .0" )
4848 def test_dbus_non_root_access (
49- self ,
50- request ,
51- bitbake_variables ,
52- connection ,
53- mender_auth_binary ,
54- mender_auth_service ,
49+ self , request , bitbake_variables , connection ,
5550 ):
5651 """Test that only root user can access Mender DBus API."""
5752
5853 # This is the command that is expected to fail for non-root user
5954 dbus_send_command = "dbus-send --system --dest=io.mender.AuthenticationManager --print-reply /io/mender/AuthenticationManager io.mender.Authentication1.GetJwtToken"
6055
6156 try :
62- connection .run (f" { mender_auth_binary } bootstrap" , warn = True )
63- connection .run (f "systemctl start { mender_auth_service } " )
57+ connection .run ("mender-auth bootstrap" , warn = True )
58+ connection .run ("systemctl start mender-authd " )
6459
6560 # Wait one state machine cycle for the D-Bus API to be available
6661 for _ in range (60 ):
67- result = connection .run (f "journalctl --unit { mender_auth_service } " )
62+ result = connection .run ("journalctl --unit mender-authd " )
6863 if (
6964 "Authorize failed:" in result .stdout
7065 or "Failed to authorize" in result .stdout
@@ -88,23 +83,17 @@ def test_dbus_non_root_access(
8883 ), result .stderr
8984
9085 finally :
91- connection .run (f "systemctl stop { mender_auth_service } " )
86+ connection .run ("systemctl stop mender-authd " )
9287 cleanup_mender_state (request , connection )
9388
94- @pytest .mark .min_mender_version ("2.5 .0" )
89+ @pytest .mark .min_mender_version ("4.0 .0" )
9590 def test_dbus_fetch_jwt_token (
96- self ,
97- request ,
98- bitbake_variables ,
99- connection ,
100- setup_mock_server ,
101- mender_auth_binary ,
102- mender_auth_service ,
91+ self , request , bitbake_variables , connection , setup_mock_server ,
10392 ):
10493 """Test that the JWT token can be fetched using D-Bus."""
10594
10695 # bootstrap the auth service
107- result = connection .run (f" { mender_auth_binary } bootstrap --forcebootstrap" )
96+ result = connection .run ("mender-auth bootstrap --forcebootstrap" )
10897 assert result .exited == 0
10998
11099 try :
@@ -117,7 +106,7 @@ def test_dbus_fetch_jwt_token(
117106 # get the JWT token via D-Bus
118107 try :
119108 # start the mender-auth service
120- result = connection .run (f "systemctl start { mender_auth_service } " )
109+ result = connection .run ("systemctl start mender-authd " )
121110 assert result .exited == 0
122111
123112 # fetch the JWT token
@@ -163,7 +152,7 @@ def test_dbus_fetch_jwt_token(
163152
164153 finally :
165154 p .terminate ()
166- connection .run (f "systemctl stop { mender_auth_service } " )
155+ connection .run ("systemctl stop mender-authd " )
167156 connection .run ("rm -f /tmp/dbus-monitor.log" )
168157
169158 finally :
0 commit comments