[PATCH v1 08/16] test/qtest/aspeed_smc-test: Move testcases to test_palmetto_bmc function

Jamin Lin via posted 16 patches 4 days, 17 hours ago
There is a newer version of this series
[PATCH v1 08/16] test/qtest/aspeed_smc-test: Move testcases to test_palmetto_bmc function
Posted by Jamin Lin via 4 days, 17 hours ago
So far, the test cases are used for testing SMC model with AST2400 BMC.
However, AST2400 is end off live and ASPEED is no longer support this SOC.
To test SMC model for AST2500, AST2600 and AST1030, move the test cases
from main to test_palmetto_bmc function.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
 tests/qtest/aspeed_smc-test.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/tests/qtest/aspeed_smc-test.c b/tests/qtest/aspeed_smc-test.c
index 4673371d95..ec1fa6ec15 100644
--- a/tests/qtest/aspeed_smc-test.c
+++ b/tests/qtest/aspeed_smc-test.c
@@ -610,14 +610,12 @@ static void test_write_block_protect_bottom_bit(void)
     flash_reset();
 }
 
-int main(int argc, char **argv)
+static int test_palmetto_bmc(void)
 {
     g_autofree char *tmp_path = NULL;
     int ret;
     int fd;
 
-    g_test_init(&argc, &argv, NULL);
-
     fd = g_file_open_tmp("qtest.m25p80.XXXXXX", &tmp_path, NULL);
     g_assert(fd >= 0);
     ret = ftruncate(fd, FLASH_SIZE);
@@ -644,8 +642,18 @@ int main(int argc, char **argv)
 
     flash_reset();
     ret = g_test_run();
-
     qtest_quit(global_qtest);
     unlink(tmp_path);
+
+    return ret;
+}
+
+int main(int argc, char **argv)
+{
+    int ret;
+
+    g_test_init(&argc, &argv, NULL);
+    ret = test_palmetto_bmc();
+
     return ret;
 }
-- 
2.34.1
Re: [SPAM] [PATCH v1 08/16] test/qtest/aspeed_smc-test: Move testcases to test_palmetto_bmc function
Posted by Cédric Le Goater 1 day, 11 hours ago
On 10/18/24 07:31, Jamin Lin wrote:
> So far, the test cases are used for testing SMC model with AST2400 BMC.
> However, AST2400 is end off live and ASPEED is no longer support this SOC.
> To test SMC model for AST2500, AST2600 and AST1030, move the test cases
> from main to test_palmetto_bmc function.
> 
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>



Reviewed-by: Cédric Le Goater <clg@redhat.com>

Thanks,

C.


> ---
>   tests/qtest/aspeed_smc-test.c | 16 ++++++++++++----
>   1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/qtest/aspeed_smc-test.c b/tests/qtest/aspeed_smc-test.c
> index 4673371d95..ec1fa6ec15 100644
> --- a/tests/qtest/aspeed_smc-test.c
> +++ b/tests/qtest/aspeed_smc-test.c
> @@ -610,14 +610,12 @@ static void test_write_block_protect_bottom_bit(void)
>       flash_reset();
>   }
>   
> -int main(int argc, char **argv)
> +static int test_palmetto_bmc(void)
>   {
>       g_autofree char *tmp_path = NULL;
>       int ret;
>       int fd;
>   
> -    g_test_init(&argc, &argv, NULL);
> -
>       fd = g_file_open_tmp("qtest.m25p80.XXXXXX", &tmp_path, NULL);
>       g_assert(fd >= 0);
>       ret = ftruncate(fd, FLASH_SIZE);
> @@ -644,8 +642,18 @@ int main(int argc, char **argv)
>   
>       flash_reset();
>       ret = g_test_run();
> -
>       qtest_quit(global_qtest);
>       unlink(tmp_path);
> +
> +    return ret;
> +}
> +
> +int main(int argc, char **argv)
> +{
> +    int ret;
> +
> +    g_test_init(&argc, &argv, NULL);
> +    ret = test_palmetto_bmc();
> +
>       return ret;
>   }