Add validate target for monolithic policy.

This commit is contained in:
Chris PeBenito 2015-02-08 23:15:29 -05:00
parent 1a1b3bd583
commit bf1d9c5b83
2 changed files with 13 additions and 20 deletions

View File

@ -71,25 +71,9 @@ install:
# Use a heartbeat loop to produce output while compiling the policy, which takes a quite long time.
script:
- POLVER=$(checkpolicy -V | cut -d' ' -f1)
- echo $TYPE $DISTRO $DIRECT_INITRC $MONOLITHIC $POLVER
# Prepare sources:
- echo $TYPE $DISTRO $DIRECT_INITRC $MONOLITHIC
- make bare
- make conf
# Monolithic builds:
- if [ "$MONOLITHIC" = y ]; then
( for A in $(seq 8) ; do sleep 300 ; echo "Heartbeat $((A*5)) minutes" ; done ) &
make ;
fi
- if [ "$MONOLITHIC" = y ]; then make file_contexts ; fi
- if [ "$MONOLITHIC" = y ]; then setfiles -c policy.$POLVER file_contexts ; fi
# Modular builds:
- if [ "$MONOLITHIC" = n ]; then make base ; fi
- if [ "$MONOLITHIC" = n ]; then make modules ; fi
- if [ "$MONOLITHIC" = n ]; then
( for A in $(seq 8) ; do sleep 300 ; echo "Heartbeat $((A*5)) minutes" ; done ) &
make validate ;
fi
- ( for A in $(seq 8) ; do sleep 300 ; echo "Heartbeat $((A*5)) minutes" ; done ) &
- make
- make validate

View File

@ -205,6 +205,15 @@ $(ncpath): $(net_contexts)
@$(INSTALL) -d -m 0755 $(@D)
$(verbose) $(INSTALL) -m 0644 $^ $@
########################################
#
# Validate file contexts
#
validate: $(fc) $(polver)
@echo "Validating $(NAME) file_contexts."
$(verbose) $(SETFILES) -q -c $(polver) $(fc)
@echo "Success."
########################################
#
# Run policy source checks