From 622b2b365586470ed3cc37a8d71457c20b137de5 Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Fri, 20 Oct 2023 00:23:26 +0200 Subject: [PATCH] Remove cgroup PAL test The memory related cgroup stuff that this test was testing was removed in a recent PR and I've forgotten to remove the test. --- src/coreclr/pal/tests/palsuite/CMakeLists.txt | 1 - .../pal/tests/palsuite/compilableTests.txt | 1 - .../miscellaneous/CGroup/test1/test.cpp | 52 ------------------- 3 files changed, 54 deletions(-) delete mode 100644 src/coreclr/pal/tests/palsuite/miscellaneous/CGroup/test1/test.cpp diff --git a/src/coreclr/pal/tests/palsuite/CMakeLists.txt b/src/coreclr/pal/tests/palsuite/CMakeLists.txt index f9166670e1240..ee5a58f608ec8 100644 --- a/src/coreclr/pal/tests/palsuite/CMakeLists.txt +++ b/src/coreclr/pal/tests/palsuite/CMakeLists.txt @@ -458,7 +458,6 @@ add_executable_clr(paltests locale_info/WideCharToMultiByte/test3/test3.cpp locale_info/WideCharToMultiByte/test4/test4.cpp locale_info/WideCharToMultiByte/test5/test5.cpp - miscellaneous/CGroup/test1/test.cpp miscellaneous/CloseHandle/test1/test.cpp miscellaneous/CloseHandle/test2/test.cpp miscellaneous/FlushInstructionCache/test1/test1.cpp diff --git a/src/coreclr/pal/tests/palsuite/compilableTests.txt b/src/coreclr/pal/tests/palsuite/compilableTests.txt index 8b388c44004b9..b96903dbc44d1 100644 --- a/src/coreclr/pal/tests/palsuite/compilableTests.txt +++ b/src/coreclr/pal/tests/palsuite/compilableTests.txt @@ -358,7 +358,6 @@ locale_info/WideCharToMultiByte/test2/paltest_widechartomultibyte_test2 locale_info/WideCharToMultiByte/test3/paltest_widechartomultibyte_test3 locale_info/WideCharToMultiByte/test4/paltest_widechartomultibyte_test4 locale_info/WideCharToMultiByte/test5/paltest_widechartomultibyte_test5 -miscellaneous/CGroup/test1/paltest_cgroup_test1 miscellaneous/CloseHandle/test1/paltest_closehandle_test1 miscellaneous/CloseHandle/test2/paltest_closehandle_test2 miscellaneous/FlushInstructionCache/test1/paltest_flushinstructioncache_test1 diff --git a/src/coreclr/pal/tests/palsuite/miscellaneous/CGroup/test1/test.cpp b/src/coreclr/pal/tests/palsuite/miscellaneous/CGroup/test1/test.cpp deleted file mode 100644 index 8b1ee94ba315f..0000000000000 --- a/src/coreclr/pal/tests/palsuite/miscellaneous/CGroup/test1/test.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for CGroup -** -** -** Steps to run this test on ubuntu: -** 1. sudo apt-get install cgroup-bin -** 2. sudo vi /etc/default/grub -** Add cgroup_enable=memory swapaccount=1 to GRUB_CMDLINE_LINUX_DEFAULT -** 3. sudo update-grub -** 4. reboot -** 5. sudo cgcreate -g cpu,memory:/myGroup -a : -t : -** 6. echo 4M > /sys/fs/cgroup/memory/mygroup/memory.limit_in_bytes -** 7. echo 4M > /sys/fs/cgroup/memory/mygroup/memory.memsw.limit_in_bytes -** 8. cgexe -g memory:/mygroup --sticky -**=========================================================*/ - -#include - -PALTEST(miscellaneous_CGroup_test1_paltest_cgroup_test1, "miscellaneous/CGroup/test1/paltest_cgroup_test1") -{ - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - size_t mem_limit = PAL_GetRestrictedPhysicalMemoryLimit(); - - FILE* file = fopen("/sys/fs/cgroup/memory/mygroup/memory.limit_in_bytes", "r"); - if(file != NULL) - { - if(mem_limit != 4194304) - Fail("Memory limit obtained from PAL_GetRestrictedPhysicalMemory is not 4MB\n"); - fclose(file); - } - - PAL_Terminate(); - return PASS; -} - - -