[PATCH] tests: Drop needless virrandom mock from two tests

Michal Privoznik posted 1 patch 1 week, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/2f064a71215a30248b86645660530814b384f39d.1669030958.git.mprivozn@redhat.com
tests/virnettlscontexttest.c | 2 +-
tests/virnettlssessiontest.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
[PATCH] tests: Drop needless virrandom mock from two tests
Posted by Michal Privoznik 1 week, 6 days ago
Nothing in virnettlscontexttest nor virnettlssessiontest calls
any of random number generator functions overridden
virrandommock. GnuTLS handles RNG within itself.

Therefore, there's no need to preload the mock.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 tests/virnettlscontexttest.c | 2 +-
 tests/virnettlssessiontest.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c
index 403cd8d0ac..2311524db8 100644
--- a/tests/virnettlscontexttest.c
+++ b/tests/virnettlscontexttest.c
@@ -627,7 +627,7 @@ mymain(void)
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
 
-VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virrandom"))
+VIR_TEST_MAIN(mymain);
 
 #else
 
diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c
index 5b98a6de3e..285cde57d8 100644
--- a/tests/virnettlssessiontest.c
+++ b/tests/virnettlssessiontest.c
@@ -482,7 +482,7 @@ mymain(void)
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
 
-VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virrandom"))
+VIR_TEST_MAIN(mymain);
 
 #else
 
-- 
2.37.4
Re: [PATCH] tests: Drop needless virrandom mock from two tests
Posted by Ján Tomko 1 week, 6 days ago
On a Monday in 2022, Michal Privoznik wrote:
>Nothing in virnettlscontexttest nor virnettlssessiontest calls
>any of random number generator functions overridden
>virrandommock. GnuTLS handles RNG within itself.
>
>Therefore, there's no need to preload the mock.
>
>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
> tests/virnettlscontexttest.c | 2 +-
> tests/virnettlssessiontest.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano