tests/testthat/helper-pretest.R

library(unix)

skip_if_no_apparmor <- function(){
  if (!aa_is_enabled())
    skip("AppArmor not enabled")
}

if(aa_is_enabled()){
  con <- aa_getcon();
  profile <- con$con;
  switch(profile,
     "/usr/bin/R" = stop("Main process must be unconfined. Please run: sudo aa-disable usr.bin.r"),
     "unconfined" = cat("Pretest: OK\n"),
     stop("Main process must be unconfined (", profile, ")")
  );
}

Try the RAppArmor package in your browser

Any scripts or data that you put into this service are public.

RAppArmor documentation built on Oct. 18, 2022, 5:08 p.m.