#40 org.selinux dbus interface is shipped by policycoreutils-dbus
Merged 4 years ago by plautrba. Opened 4 years ago by plautrba.

@@ -53,7 +53,7 @@ 

  	@echo "Type:            Sanity" >> $(METADATA)

  	@echo "TestTime:        10m" >> $(METADATA)

  	@echo "RunFor:          policycoreutils" >> $(METADATA)

- 	@echo "Requires:        policycoreutils-gui selinux-policy-minimum selinux-policy-mls selinux-policy-targeted" >> $(METADATA)

+ 	@echo "Requires:        policycoreutils-dbus selinux-policy-minimum selinux-policy-mls selinux-policy-targeted" >> $(METADATA)

  	@echo "Priority:        Normal" >> $(METADATA)

  	@echo "License:         GPLv2" >> $(METADATA)

  	@echo "Confidential:    no" >> $(METADATA)

@@ -35,7 +35,8 @@ 

  rlJournalStart

      rlPhaseStartSetup

          rlAssertRpm ${PACKAGE}

-         rlAssertRpm ${PACKAGE}-gui

+         # In past, org.selinux dbus interface was shipped in policycoreutils-gui

+         rlRun "rpm -q policycoreutils-dbus || rpm -q policycoreutils-gui" 0
omos commented 4 years ago

Wouldn't it make more sense to check for some shipped file that indicates that the dbus interface is present instead of blindly trying different RPMs? Or is that not possible?

          rlFileBackup /etc/selinux/config

          rlRun "gdbus introspect --system -d org.selinux -o /"

          rlRun "gdbus introspect --system -d org.selinux -o /org"

In past it was policycoreutils-gui so check whether at least one of them is
installed.

Resolves: https://src.fedoraproject.org/tests/selinux/issue/39

Looks good to me. ack+

Wouldn't it make more sense to check for some shipped file that indicates that the dbus interface is present instead of blindly trying different RPMs? Or is that not possible?

Of course, it is possible. Some TCs (which require semanage) already do that.

Wouldn't it make more sense to check for some shipped file that indicates that the dbus interface is present instead of blindly trying different RPMs? Or is that not possible?

I believe there was a request in past to see a version of installed packages directly in the test log.
If there's no such requirement, you don't have to have to check rpm or file, you just start with the test which would fail if the buds interface doesn't work

Pull-Request has been merged by plautrba

4 years ago

The requirement to see a version of installed packages is still true. rlAssertRpm "" can be replaced by rlRun "rpm -qf /path/to/file"

I believe there was a request in past to see a version of installed packages directly in the test log.

Good point. I guess it can still be done better with -qf as Milos suggested, but let's maybe defer that to some larger cleanup...

No need to defer, feel free to open PR now if you have a patch.