aboutsummaryrefslogtreecommitdiff
path: root/zram01.sh
diff options
context:
space:
mode:
Diffstat (limited to 'zram01.sh')
-rwxr-xr-xzram01.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/zram01.sh b/zram01.sh
index 8d98e2d..7effa8b 100755
--- a/zram01.sh
+++ b/zram01.sh
@@ -8,12 +8,12 @@
#
# This program is distributed in the hope that it would be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Test creates several zram devices with different filesystems on them.
# It fills each device with zeros and checks that compression works.
@@ -21,6 +21,9 @@
# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
# Modified: Naresh Kamboju <naresh.kamboju@linaro.org>
+TCID="zram01"
+ERR_CODE=0
+
. ./zram_lib.sh
# Test will create the following number of zram devices:
@@ -73,13 +76,15 @@ zram_fill_fs()
if [ "$v" -lt 100 ]; then
echo "FAIL compression ratio: 0.$v:1"
+ ERR_CODE=-1
zram_cleanup
return
fi
- echo "ZRAM compression ratio: $(echo "scale=2; $v / 100 " | bc):1 : PASS"
+ echo "zram compression ratio: $(echo "scale=2; $v / 100 " | bc):1 : OK"
}
+zram_load
zram_max_streams
zram_compress_alg
zram_set_disksizes
@@ -89,3 +94,10 @@ zram_mount
zram_fill_fs
zram_cleanup
+zram_unload
+
+if [ $ERR_CODE -ne 0 ]; then
+ echo "$TCID : FAIL"
+else
+ echo "$TCID : PASS"
+fi