<div dir="ltr"><div class="gmail_extra">Mylène Josserand <span dir="ltr"><<a href="mailto:mylene.josserand@bootlin.com" target="_blank">mylene.josserand@bootlin.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Now that tst_getconf is available to use "sysconf()" function<br>
instead of relying on the application "getconf", let's convert<br>
all the tests to it.<br>
<br>
Signed-off-by: Mylène Josserand <<a href="mailto:mylene.josserand@bootlin.com">mylene.josserand@bootlin.com</a>><br>
---<br>
 testcases/commands/du/du01.sh                                    | 2 +-<br>
 testcases/commands/mkswap/<wbr>mkswap01.sh                            | 2 +-<br>
 testcases/kernel/controllers/<wbr>cpuset/cpuset_regression_test.<wbr>sh    | 2 +-<br>
 testcases/kernel/controllers/<wbr>memcg/control/memcg_control_<wbr>test.sh | 2 +-<br>
 testcases/kernel/controllers/<wbr>memcg/functional/memcg_lib.sh       | 4 ++--<br>
 testcases/kernel/numa/numa01.<wbr>sh                                  | 2 +-<br>
 testcases/lib/test.sh                                            | 4 ++--<br>
 7 files changed, 9 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/testcases/commands/du/du01.<wbr>sh b/testcases/commands/du/du01.<wbr>sh<br>
index ed1df568f..c75068255 100755<br>
--- a/testcases/commands/du/du01.<wbr>sh<br>
+++ b/testcases/commands/du/du01.<wbr>sh<br>
@@ -73,7 +73,7 @@ du_test()<br>
 }<br>
<br>
 block_size=512<br>
-page_size=$(getconf PAGESIZE)<br>
+page_size=$(tst_getconf PAGESIZE)<br>
 if [ "$page_size" -lt 1024 ]; then<br>
        tst_brk TBROK "Page size < 1024"<br>
 fi<br>
diff --git a/testcases/commands/mkswap/<wbr>mkswap01.sh b/testcases/commands/mkswap/<wbr>mkswap01.sh<br>
index 1c01c86b2..743db4c1a 100755<br>
--- a/testcases/commands/mkswap/<wbr>mkswap01.sh<br>
+++ b/testcases/commands/mkswap/<wbr>mkswap01.sh<br>
@@ -29,7 +29,7 @@ setup()<br>
 {<br>
        UUID=`uuidgen`<br>
<br>
-       PAGE_SIZE=`<div style="font-size:small;display:inline" class="gmail_default">​​</div>getconf PAGE_SIZE`<br>
+       PAGE_SIZE=`tst_getconf PAGE_SIZE`<br></blockquote><div><br></div><div><div style="font-size:small" class="gmail_default">Here should be corrected, from the patch 1/2, tst_getconf only supports PAGESIZE.​</div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
        # Here get the size of the device and align it down to be the<br>
        # multiple of $PAGE_SIZE and use that as the size for testing.<br>
diff --git a/testcases/kernel/<wbr>controllers/cpuset/cpuset_<wbr>regression_test.sh b/testcases/kernel/<wbr>controllers/cpuset/cpuset_<wbr>regression_test.sh<br>
index 4a104a3ad..72a2a944c 100755<br>
--- a/testcases/kernel/<wbr>controllers/cpuset/cpuset_<wbr>regression_test.sh<br>
+++ b/testcases/kernel/<wbr>controllers/cpuset/cpuset_<wbr>regression_test.sh<br>
@@ -34,7 +34,7 @@ setup()<br>
                tst_brkm TCONF "Test must be run with kernel 3.18.0 or newer"<br>
        fi<br>
<br>
-       local cpu_num=$(getconf _NPROCESSORS_ONLN)<br>
+       local cpu_num=$(tst_getconf _NPROCESSORS_ONLN)<br>
        if [ $cpu_num -lt 2 ]; then<br>
                tst_brkm TCONF "We need 2 cpus at least to have test"<br>
        fi<br>
diff --git a/testcases/kernel/<wbr>controllers/memcg/control/<wbr>memcg_control_test.sh b/testcases/kernel/<wbr>controllers/memcg/control/<wbr>memcg_control_test.sh<br>
index 1d158729c..4d9f1bb5d 100644<br>
--- a/testcases/kernel/<wbr>controllers/memcg/control/<wbr>memcg_control_test.sh<br>
+++ b/testcases/kernel/<wbr>controllers/memcg/control/<wbr>memcg_control_test.sh<br>
@@ -41,7 +41,7 @@ export TST_COUNT=0<br>
 export TMP=${TMP:-/tmp}<br>
 cd $TMP<br>
<br>
-PAGE_SIZE=$(getconf PAGESIZE)<br>
+PAGE_SIZE=$(tst_getconf PAGESIZE)<br>
<br>
 TOT_MEM_LIMIT=$PAGE_SIZE<br>
 ACTIVE_MEM_LIMIT=$PAGE_SIZE<br>
diff --git a/testcases/kernel/<wbr>controllers/memcg/functional/<wbr>memcg_lib.sh b/testcases/kernel/<wbr>controllers/memcg/functional/<wbr>memcg_lib.sh<br>
index 6a6af853b..cd16dc685 100755<br>
--- a/testcases/kernel/<wbr>controllers/memcg/functional/<wbr>memcg_lib.sh<br>
+++ b/testcases/kernel/<wbr>controllers/memcg/functional/<wbr>memcg_lib.sh<br>
@@ -29,9 +29,9 @@ if [ "x$(grep -w memory /proc/cgroups | cut -f4)" != "x1" ]; then<br>
        tst_brkm TCONF "Kernel does not support the memory resource controller"<br>
 fi<br>
<br>
-PAGESIZE=$(getconf PAGESIZE)<br>
+PAGESIZE=$(tst_getconf PAGESIZE)<br>
 if [ $? -ne 0 ]; then<br>
-       tst_brkm TBROK "getconf PAGESIZE failed"<br>
+       tst_brkm TBROK "tst_getconf PAGESIZE failed"<br>
 fi<br>
<br>
 HUGEPAGESIZE=$(awk '/Hugepagesize/ {print $2}' /proc/meminfo)<br>
diff --git a/testcases/kernel/numa/<wbr>numa01.sh b/testcases/kernel/numa/<wbr>numa01.sh<br>
index 27a2f2f7c..65e9b7dd5 100755<br>
--- a/testcases/kernel/numa/<wbr>numa01.sh<br>
+++ b/testcases/kernel/numa/<wbr>numa01.sh<br>
@@ -83,7 +83,7 @@ wait_for_support_numa()<br>
 setup()<br>
 {<br>
        export MB=$((1024*1024))<br>
-       export PAGE_SIZE=$(getconf PAGE_SIZE)<br>
+       export PAGE_SIZE=$(tst_getconf PAGE_SIZE)<br></blockquote><div><br></div><div style="font-size:small" class="gmail_default">​Here as well.</div><div style="font-size:small" class="gmail_default">​</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
        export HPAGE_SIZE=$(awk '/Hugepagesize:/ {print $2}' /proc/meminfo)<br>
<br>
        total_nodes=0<br>
diff --git a/testcases/lib/test.sh b/testcases/lib/test.sh<br>
index bce9893a9..650712181 100644<br>
--- a/testcases/lib/test.sh<br>
+++ b/testcases/lib/test.sh<br>
@@ -421,9 +421,9 @@ fi<br>
 if [ "$TST_NEEDS_CHECKPOINTS" = "1" ]; then<br>
        LTP_IPC_PATH="/dev/shm/ltp_${<wbr>TCID}_$$"<br>
<br>
-       LTP_IPC_SIZE=$(getconf PAGESIZE)<br>
+       LTP_IPC_SIZE=$(tst_getconf PAGESIZE)<br>
        if [ $? -ne 0 ]; then<br>
-               tst_brkm TBROK "getconf PAGESIZE failed"<br>
+               tst_brkm TBROK "tst_getconf PAGESIZE failed"<br>
        fi<br>
<br>
        ROD_SILENT dd if=/dev/zero of="$LTP_IPC_PATH" bs="$LTP_IPC_SIZE" count=1<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.11.0<br>
<br>
<br>
-- <br>
Mailing list info: <a href="https://lists.linux.it/listinfo/ltp" rel="noreferrer" target="_blank">https://lists.linux.it/<wbr>listinfo/ltp</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div>
</div></div>