From 2e2a5db207b51a476f5cf1a7a485d95fd61ed7fe Mon Sep 17 00:00:00 2001 From: Yongjoo Ahn Date: Tue, 12 Dec 2023 15:08:57 +0900 Subject: [PATCH] [UTC][nnstreamer][Non-ACR] Remove lstat call - In some environment, the TC got timeout in syscall lstat sometimes. - Replace the call with g_file_get_contents, and remove unnecessary assert Change-Id: Ic3a0a957c97eca6f905f71c8558669db913a7b2f Signed-off-by: Yongjoo Ahn --- src/utc/nnstreamer/utc-nnstreamer-scenario.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/utc/nnstreamer/utc-nnstreamer-scenario.c b/src/utc/nnstreamer/utc-nnstreamer-scenario.c index 84947d398..5120665a3 100644 --- a/src/utc/nnstreamer/utc-nnstreamer-scenario.c +++ b/src/utc/nnstreamer/utc-nnstreamer-scenario.c @@ -259,11 +259,13 @@ int utc_nnstreamer_scenario_pipeline_state_test_p3 (void) gchar *fullpath = g_build_path ("/", _tmpdir, _dirname, NULL); gchar *dir = g_mkdtemp ((gchar *) fullpath); gchar *file1 = g_build_path ("/", dir, "valve1", NULL); + uint8_t *content = NULL; + gsize len = 0; + gchar * pipeline = g_strdup_printf - ("videotestsrc is-live=true ! videoconvert ! videoscale ! video/x-raw,format=RGBx,width=16,height=16,framerate=10/1 ! tensor_converter ! queue ! valve name=valve1 ! filesink location=\"%s\"", + ("videotestsrc is-live=true ! videoconvert ! videoscale ! video/x-raw,format=RGBx,width=16,height=16,framerate=10/1 ! tensor_converter ! queue ! valve name=valve1 ! filesink location=\"%s\" buffer-mode=unbuffered", file1); - GStatBuf buf; ml_pipeline_h handle; ml_pipeline_state_e state; @@ -293,10 +295,6 @@ int utc_nnstreamer_scenario_pipeline_state_test_p3 (void) status = ml_pipeline_stop (handle); assert_eq (status, ML_ERROR_NONE); - status = g_lstat (file1, &buf); - assert_eq (status, 0); - assert_eq (buf.st_size, 0); - status = ml_pipeline_start (handle); assert_eq (status, ML_ERROR_NONE); @@ -314,11 +312,10 @@ int utc_nnstreamer_scenario_pipeline_state_test_p3 (void) status = ml_pipeline_destroy (handle); assert_eq (status, ML_ERROR_NONE); - status = g_lstat (file1, &buf); - assert_eq (status, 0); - assert_geq (buf.st_size, 2048); /* At least two frames during SLEEP_TIME */ - assert_eq (buf.st_size % 1024, 0); /* It should be divided by 1024 */ + assert_eq (g_file_get_contents (file1, (gchar **) &content, &len, NULL), TRUE); + assert_geq (len, 1024); + g_free (content); g_free (fullpath); g_free (file1); -- 2.34.1