From 9b8c6ed485ba99ccd8a68c78739b984ef4aa0433 Mon Sep 17 00:00:00 2001 From: Andrew Burke <31974658+atburke@users.noreply.github.com> Date: Wed, 4 Dec 2024 11:28:25 -0800 Subject: [PATCH] Fix asserts in utmp tests (#49777) --- integration/utmp_integration_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/integration/utmp_integration_test.go b/integration/utmp_integration_test.go index dd109d6ab5acc..22ba13bd46b76 100644 --- a/integration/utmp_integration_test.go +++ b/integration/utmp_integration_test.go @@ -116,10 +116,10 @@ func TestRootUTMPEntryExists(t *testing.T) { require.NoError(t, err) require.EventuallyWithTf(t, func(collect *assert.CollectT) { - require.NoError(collect, uacc.UserWithPtyInDatabase(s.utmpPath, teleportTestUser)) - require.NoError(collect, uacc.UserWithPtyInDatabase(s.wtmpPath, teleportTestUser)) + assert.NoError(collect, uacc.UserWithPtyInDatabase(s.utmpPath, teleportTestUser)) + assert.NoError(collect, uacc.UserWithPtyInDatabase(s.wtmpPath, teleportTestUser)) // Ensure than an entry was not written to btmp. - require.True(collect, trace.IsNotFound(uacc.UserWithPtyInDatabase(s.btmpPath, teleportTestUser)), "unexpected error: %v", err) + assert.True(collect, trace.IsNotFound(uacc.UserWithPtyInDatabase(s.btmpPath, teleportTestUser)), "unexpected error: %v", err) }, 5*time.Minute, time.Second, "did not detect utmp entry within 5 minutes") }) @@ -152,10 +152,10 @@ func TestRootUTMPEntryExists(t *testing.T) { require.NoError(t, err) require.EventuallyWithT(t, func(collect *assert.CollectT) { - require.NoError(collect, uacc.UserWithPtyInDatabase(s.btmpPath, teleportFakeUser)) + assert.NoError(collect, uacc.UserWithPtyInDatabase(s.btmpPath, teleportFakeUser)) // Ensure that entries were not written to utmp and wtmp - require.True(collect, trace.IsNotFound(uacc.UserWithPtyInDatabase(s.utmpPath, teleportFakeUser)), "unexpected error: %v", err) - require.True(collect, trace.IsNotFound(uacc.UserWithPtyInDatabase(s.wtmpPath, teleportFakeUser)), "unexpected error: %v", err) + assert.True(collect, trace.IsNotFound(uacc.UserWithPtyInDatabase(s.utmpPath, teleportFakeUser)), "unexpected error: %v", err) + assert.True(collect, trace.IsNotFound(uacc.UserWithPtyInDatabase(s.wtmpPath, teleportFakeUser)), "unexpected error: %v", err) }, 5*time.Minute, time.Second, "did not detect btmp entry within 5 minutes") })