Skip to content

Testing

chl337 edited this page May 27, 2024 · 1 revision

Test Quark with LinuxTestProject

  1. Build Quark

  2. Create a Docker image:

    • Dockerfile:

      FROM ubuntu:18.04
      
      RUN apt update && apt install -y build-essential \
                                      apt-utils \
                                      bash \
                                      vim \
                                      libcap-dev \
                                      libnuma1 \
                                      libnuma-dev \
                                      autoconf \
      				git \
      				pkg-config \
      				gdb
      WORKDIR /home/
      RUN git clone https://github.com/linux-test-project/ltp.git
      WORKDIR ltp/
      RUN make autotools && ./configure \
          && make -C testcases/lib
      ENV PATH="${PATH}:/home/ltp/testcases/lib/"
      #
      #Uncomment and addapt for own test-script
      #
      #COPY qtest /home/
      #RUN chmod +x /home/qtest
      #CMD ["/bin/bash", "/home/qtest"]
      #
      #Comment this out if you use the above
      #
      CMD ["/bin/bash"]
    • build: docker build -t qltp:latest .

  3. Run tests

    1. Interactive:

      1. Start container: docker run --rm -it --runtime=quark qltp

      2. Follow guide for signel tests: link.

    2. Automated:

      1. Create a script, e.g.:

        #!/bin/bash
        
        ROOTDIR=/home/ltp/testcases
        KERNEL=${ROOTDIR}/kernel
        MEM=${KERNEL}/mem
        MEMTEST=(mem shmt vma vmtests)
        
        for dir in ${MEMTEST[@]};do
        	testdir=${MEM}/${dir}
        	make -C ${testdir} > /dev/null 2>&1
        	PATH=$PATH:${testdir}
        	for file in ${testdir}/*;do
        		if [[ -x ${file} ]];then
        			${file}
        		fi
        	done
        done
      2. Adjust Dockerfile (see comments).

Remarks

  1. Building and running all the tests takes a long time - better to avoid it.

  2. A test may cause the container to crush

    • Build Quark with debug symbols

    • Set log level to Debug for more information.

Results on x86_64:

Test that currently execute - HEAD:fbf09b2

  • p: pass

  • f: fail

  • b: broken

  • xyz_n: TestName_subpart

  • Testcases:

    1. kernel:

      1. mem:

        1. mem:

          • (p): mem02

          • (f):

        2. shmt:

          • (p): shmt02, shmt03, shmt06_1, shmt06_3, shmt07, shmt08_1, shmt08_4, shmt08_1

          • (f): shmt04, shmt05, shmt06_02, shmt08_2, shmt08_3, shmt09_2

        3. vma:

          • (p): vma04_1, vma04_4, vma04_5, vma05.sh_1

          • (f): vma01_1, vma04_2, vma04_3,

          • (b): vma02_1, vma02_2, vma05.sh_1

        4. vmtest:

          • (p): data_space, stack_space

          • (f):

          • (b):

        5. page:

          • (p): page01, page02

          • (f):

          • (b):

Clone this wiki locally