itsallcode / openfasttrace

Open source requirement tracing suite
GNU General Public License v3.0
103 stars 21 forks source link

`testReportService.testReportToIllegalPathThrowsReportExpection` fails when running in Docker #184

Closed redcatbear closed 1 year ago

redcatbear commented 6 years ago

Description

The test TestReportService.testReportToIllegalPathThrowsReportExpection fails when running in Docker since the process capability CAP_DAC_OVERRIDE is set.

This occurs for example if someone tries to install OFT directly by cloning the GH repository in a Docker container. One of the integration tests requires that a r/o file is created in order to force an exception when writing a report. Since the CAP_DAC_OVERRIDE is set, marking a file as r/o is simply ignored.

While that is a shortcoming on the Docker-side of the problem and installation from a Git clone is not the best idea, we still should skip the test in this scenario for maximum compatibility.

You can verify this outside of OFT by issuing

touch foo.txt
chmod a-w foo.txt 
echo "more" >> foo.txt

This should fail, but it runs just fine.

If you enter

capsh --print

you get

Current: = cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_setpcap,cap_net_bind_service,cap_net_raw,cap_sys_chroot,cap_mknod,cap_audit_write,cap_setfcap+eip

Steps to Reproduce

  1. Create a docker container from image "fedora 28" calling it openfasttrace
  2. Run
    docker exec -ti openfasttrace /bin/bash
  3. Test fails

Expected behavior

Test succeeds or is skipped.

Environment

redcatbear commented 1 year ago

Not worth fixing at the moment.