#471 test if semanage port complains when erasing duplicated local customization
Merged 2 months ago by mmalik. Opened 2 months ago by mmalik.
tests/ mmalik/selinux already-defined-modifying-instead  into  main

@@ -54,13 +54,14 @@ 

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

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

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

+ 	@echo "Requires:        audit" >> $(METADATA)

+ 	@echo "Requires:        coreutils" >> $(METADATA)

+ 	@echo "Requires:        grep" >> $(METADATA)

+ 	@echo "Requires:        libselinux" >> $(METADATA)

+ 	@echo "Requires:        libselinux-utils" >> $(METADATA)

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

  	@echo "Requires:        policycoreutils-python-utils" >> $(METADATA)

  	@echo "Requires:        setools-console" >> $(METADATA)

- 	@echo "Requires:        libselinux" >> $(METADATA)

- 	@echo "Requires:        libselinux-utils" >> $(METADATA)

- 	@echo "Requires:        coreutils" >> $(METADATA)

- 	@echo "Requires:        grep" >> $(METADATA)

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

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

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

@@ -6,13 +6,14 @@ 

  component:

    - policycoreutils

  recommend:

+   - audit

+   - coreutils

+   - grep

+   - libselinux

+   - libselinux-utils

    - policycoreutils

    - policycoreutils-python-utils

    - setools-console

-   - libselinux

-   - libselinux-utils

-   - coreutils

-   - grep

  duration: 15m

  extra-summary: /CoreOS/policycoreutils/Regression/semanage-port-add-delete-problems

  extra-task: /CoreOS/policycoreutils/Regression/semanage-port-add-delete-problems

@@ -115,8 +115,12 @@ 

          rlRun "semanage port -a -t smtp_port_t -p tcp 25 2>&1 | tee ${OUTPUT_FILE}"

          rlAssertGrep "port .* already defined" ${OUTPUT_FILE} -i

          rlRun "semanage port -l | grep 'smtp_port_t.*tcp.*25'"

+         rm -f ${OUTPUT_FILE}

          rlRun "semanage port -d -t smtp_port_t -p tcp 25 2>&1 | tee ${OUTPUT_FILE}"

-         rlAssertGrep "port .* is defined in policy.*cannot be deleted" ${OUTPUT_FILE} -i

+         # the error may not appear because the local customization can be deleted always

+         if [ -s ${OUTPUT_FILE} ] ; then

+             rlAssertGrep "port .* is defined in policy.*cannot be deleted" ${OUTPUT_FILE} -i

+         fi

          rlRun "semanage port -d -t smtp_port_t -p tcp 25 2>&1 | tee ${OUTPUT_FILE}"

          rlAssertGrep "port .* is defined in policy.*cannot be deleted" ${OUTPUT_FILE} -i

          rlRun "semanage port -l | grep 'smtp_port_t.*tcp.*25'"

rebased onto f1d8d6101c14da9b9ace7d78362220505ccc5f11

2 months ago

I need to correct the commit message. The duplication of port context patterns happens during the add operation.

The automated test passed as expected.

rebased onto 8c6d816ab78d3a0f9b70d140977e8a81ba022c67

2 months ago

The commit message now explains what is the change about.

rebased onto 85a3f36

2 months ago

Pull-Request has been merged by mmalik

2 months ago