Files
fs-test/README.md
T

5.1 KiB

Filesystem Test

Example of use

git clone https://gitlab.resds.ru/vlasov.dv/fs-test.git
cd fs-test
chmod +x create-vm.sh
./create-vm.sh --bootstrap-env env
vi env
sudo ./create-vm.sh -e ./env
sudo less -R /tmp/create-vm/Ubuntu22.04/serial.log # For observing the test

As a result you will get something like that:

Using uid:0, gid:0.
Writing a byte at a time...done
Writing intelligently...done
Rewriting...done
Reading a byte at a time...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version  2.00       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Name:Size etc        /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
Ubuntu22         4G  751k  97  155m  33 35.4m  12  974k  96 41.8m   8 227.2  11
Latency             15686us     203ms     367ms     358ms     282ms     396ms
Version  2.00       ------Sequential Create------ --------Random Create--------
Ubuntu22            -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16     1   2 +++++ +++ 724249376   2     1   1 +++++ +++ 724249376   1
Latency              1858ms   46383us    1105ms    2012ms    2620us    2165ms
1.98,2.00,Ubuntu22,1,1700182713,4G,,8192,5,751,97,159132,33,36287,12,974,96,42847,8,227.2,11,16,,,,,49,2,+++++,+++,95,2,45,1,+++++,+++,78,1,15686us,203ms,367ms,358ms,282ms,396ms,1858ms,46383us,1105ms,2012ms,2620us,2165ms

Usage of ./create-vm.sh:

usage:
  ./create-vm.sh required_args [optional_args] OR
  ./create-vm.sh misc_args

Create a new virtual machine according to specified parameters and run
test on filesystem

misc_args:
  --bootstrap-env         ENV_PATH       create template env file and exit

required_args:
  -n, --name              NAME            name of a virtual machine
  -o, --os-variant        OS_VARIANT      operating system
  -m, --memory            MEMORY          RAM size
  -c, --vcpus             VCPUS           Amount of of cores
  -i, --image             IMAGE           URL or path to an ISO image
  -s, --size              SIZE            Size of an OS drive (example: 8G)
  -b, --bridge            BRIDGE          bridge name (LinuxBridge only)
  -a, --ip-address        IP              ip address of eth0
  -p, --prefix            PREFIX          network prefix
  -g, --gateway           GATEWAY         ip address of network gateway
  -d, --dns               DNS             ip address of dns server
  -t, --test-suite        TEST_UTIL       what should be used for the test
                                            (bonnie++ and iozone are available)
                                            default: bonnie++
  -T, --testargs          TEST_UTIL_ARGS  arguments that shoud be passed to
                                            testing program
                                            (-d for bonnie++ or -f for iozone
                                             being set automatically)
                                            default: -u 0

optional_args:
  -h, --help                              show this help message and exit
  -e, --env                               export args from env file
  -r, --rm-if-exist                       if vm exist, remove it first
                                            default: false
  -P, --pubkey            PUBKEY          place public key into autorized_keys of
                                            all defined in config.yaml users
                                            default: /home/$USER/.ssh/id_rsa.pub
  -v, --vnc-password      VNC_PASSWORD    vnc console password
                                            default: PASSWD1!
  -C, --cloud-init        CLOUD_INIT      Path to a cloud-init config - will be
                                          created if not provided

env example:
  NAME=Ubuntu22.04
  OS_VARIANT=ubuntu22.04
  MEMORY=2048
  VCPUS=2
  IMAGE=https://cloud-images.ubuntu.com/jammy/20231010/jammy-server-cloudimg-amd64.img
  SIZE=8G
  BRIDGE=virbr0
  IP=192.168.122.2
  PREFIX=24
  GATEWAY=192.168.122.1
  DNS=8.8.8.8
  TEST_UTIL=bonnie++
  TEST_UTIL_ARGS="-u 0"
  RM=true
  PUBKEY=/home/cloudadmin/.ssh/id_rsa.pub
  VNC_PASSWORD=PASSWD1!


cloud-init example:
  #cloud-config
  package_upgrade: false
  packages:
  - vim
  - htop
  - bonnie++
  - iozone3
  users:
  - name: ubuntu
    ssh-authorized-keys:
        - {{PUBKEY}}
    sudo: ['ALL=(ALL) NOPASSWD:ALL']
    ssh_pwauth: true
    lock-passwd: false
    chpasswd: {expire: False}
    groups: sudo
    shell: /bin/bash
  - name: adminuser
    ssh-authorized-keys:
        - {{PUBKEY}}
    sudo: ['ALL=(ALL) NOPASSWD:ALL']
    ssh_pwauth: true
    lock-passwd: false
    chpasswd: {expire: False}
    groups: sudo
    shell: /bin/bash
  runcmd:
  - mkdir -p {{TESTDIR}}
  - {{TEST_UTIL}} {{TEST_UTIL_ARGS}}