Browse Source

[#39898] Merged script for testing png/svg/txt and html plot into one file

check-vt100
Marcelina Oset 3 years ago
parent
commit
7895a7b526
  1. 8
      .ci.yml
  2. 28
      scripts/test.sh
  3. 20
      scripts/tests/interactive_plot_test.sh

8
.ci.yml

@ -8,8 +8,8 @@ simple_test:
FAKE_DISK: "fake_disk.ext4"
FAKE_MOUNTPOINT: "fake_mountpoint"
script:
- chmod +x scripts/tests/simple_test.sh
- ./scripts/tests/simple_test.sh
- chmod +x scripts/test.sh
- ./scripts/test.sh svg png ascii
artifacts:
when: always
paths:
@ -24,8 +24,8 @@ interactive_plot_test:
FAKE_DISK: "fake_disk.ext4"
FAKE_MOUNTPOINT: "fake_mountpoint"
script:
- chmod +x scripts/tests/interactive_plot_test.sh
- ./scripts/tests/interactive_plot_test.sh
- chmod +x scripts/test.sh
- ./scripts/test.sh html
artifacts:
when: always
paths:

28
scripts/tests/simple_test.sh → scripts/test.sh

@ -1,5 +1,10 @@
#!/bin/bash
if [[ "$@" =~ 'html' ]]
then
pip install git+https://github.com/antmicro/servis#egg=servis[bokeh]
fi
dd if=/dev/zero of=$FAKE_DISK bs=1M count=130
mkfs.ext4 $FAKE_DISK
mkdir -p $FAKE_MOUNTPOINT && mount $FAKE_DISK $FAKE_MOUNTPOINT
@ -12,15 +17,22 @@ stress -c 16 -i 1 -m 1 --vm-bytes 512M -d 1 --hdd-bytes 70M -t 160s
popd
sargraph chart save plot.svg
sargraph chart save plot.png
sargraph chart save plot.ascii
for ext in "$@"
do
sargraph chart save "plot.${ext}"
done
sargraph chart stop
test -f plot.svg
test -f plot.png
test -f plot.ascii
for ext in "$@"
do
test -f "plot.${ext}"
done
cat chart.log
echo '------Sample plot------'
cat plot.ascii
if [[ "$@" =~ 'ascii' ]]
then
echo '------Sample plot------'
cat plot.ascii
fi

20
scripts/tests/interactive_plot_test.sh

@ -1,20 +0,0 @@
#!/bin/bash
pip install git+https://github.com/antmicro/servis#egg=servis[bokeh]
dd if=/dev/zero of=$FAKE_DISK bs=1M count=130
mkfs.ext4 $FAKE_DISK
mkdir -p $FAKE_MOUNTPOINT && mount $FAKE_DISK $FAKE_MOUNTPOINT
sargraph chart start -m $FAKE_MOUNTPOINT
pushd $FAKE_MOUNTPOINT
df -h .
stress -c 16 -i 1 -m 1 --vm-bytes 512M -d 1 --hdd-bytes 70M -t 160s
popd
sargraph chart save plot.html
sargraph chart stop
test -f plot.html
cat chart.log
Loading…
Cancel
Save