]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
travis: Add test job on cgroup v2 Ubuntu 20.04 16/head
authorTom Hromatka <tom.hromatka@oracle.com>
Wed, 28 Oct 2020 14:57:09 +0000 (14:57 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 28 Oct 2020 15:02:48 +0000 (15:02 +0000)
Add a test job on Ubuntu 20.04.  Prior to running the tests, unmount
the cpuset cgroup controller and enable it in the cgroup v2 unified
hierarchy.  Once each job is complete, it notifies coveralls via a
REST call.

Unfortunately, Travis CI doesn't provide a cgroup v2 system image
and also doesn't allow us to modify the kernel boot parameters.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
.travis.yml

index 743f3ffd1ec43574c47629fd0d72adbc1b7de436..9052425966fd119e127d56a347dfba31c8642587 100644 (file)
 # along with this library; if not, see <http://www.gnu.org/licenses>.
 #
 
-dist: bionic
-sudo: false
+jobs:
+  include:
+  # test cgroup v1 on Ubuntu 18.04
+  - name: "Cgroup v1 Job"
+    stage: test
+    os: linux
+    dist: bionic
+    sudo: false
+    arch: amd64
+    before_install:
+      # see https://github.com/eddyxu/cpp-coveralls
+      - 'pip install --user cpp-coveralls'
+
+  # test a mixed system on Ubuntu 20.04
+  #     cgroup v1 controllers - blkio, cpu, cpuacct, devices, io, freezer,
+  #                             hugetlb, memory, net_cls, net_prio, rdma
+  #     cgroup v2 controllers - cpuset
+  - name: "Cgroup v2 Job"
+    stage: test
+    os: linux
+    dist: focal
+    sudo: required
+    virt: vm
+    arch: amd64
+    before_install:
+      # unmount the cpuset v1 controller.  This should make it available
+      # in the v2 hierarchy after all references have been freed
+      - 'sudo umount /sys/fs/cgroup/cpuset'
+      # wait for the references to the cpuset controller to go away
+      - 'sleep 30'
+      - 'cat /sys/fs/cgroup/unified/cgroup.controllers'
+      - 'sudo su -c "echo +cpuset > /sys/fs/cgroup/unified/cgroup.subtree_control"'
+      - 'cat /sys/fs/cgroup/unified/cgroup.subtree_control'
+
+      # see https://github.com/eddyxu/cpp-coveralls
+      - 'pip install --user cpp-coveralls'
 
 git:
   submodules: false
 
 notifications:
+  webhooks: https://coveralls.io/webhook?repo_token=xarVjTxWrquIbY9thhmlIY4qez6bL4zEHUr2E
   email:
     on_success: always
     on_failure: always
@@ -40,10 +75,6 @@ addons:
       - lxc
       - lxd
 
-before_install:
-  # see https://github.com/eddyxu/cpp-coveralls
-  - pip install --user cpp-coveralls
-
 # perform the build and fail immediately on error
 install:
   - ./bootstrap.sh
@@ -60,4 +91,5 @@ after_failure:
   - cat tests/gunit/test-suite.log
 
 after_success:
-  - coveralls --exclude tests --exclude googletest --exclude samples --exclude src/lex.l --exclude parse.y --gcov-options '\-lp'
+  - coverage combine
+  - COVERALLS_PARALLEL=true coveralls --exclude tests --exclude googletest --exclude samples --exclude src/lex.l --exclude parse.y --gcov-options '\-lp'