Skip to content

Commit

Permalink
rtld-elf: Drop dlopen_nocheri tests
Browse files Browse the repository at this point in the history
There isn't a libbasic_nocheri to dlopen these days since lib64 is
hybrid, with no non-CHERI equivalent, so these tests fail.

Fixes:	699a0c9 ("Purge the last remnants of bsd.cheri.mk")
  • Loading branch information
jrtc27 authored and bsdjhb committed Mar 16, 2024
1 parent 2a78b06 commit 6eeacd7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,9 @@ ATF_TC_BODY(dlopen_hybrid, tc)
test_dlopen_success("libbasic_hybrid.so.0", "hybrid", true);
}

ATF_TC(dlopen_nocheri);
ATF_TC_HEAD(dlopen_nocheri, tc)
{
atf_tc_set_md_var(tc, "descr",
"Check that we can dlopen() a non-CHERI library from a hybrid binary");
}
ATF_TC_BODY(dlopen_nocheri, tc)
{
test_dlopen_success("libbasic_nocheri.so.0", "not CHERI", true);
}


ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, dlopen_purecap_fail);
ATF_TP_ADD_TC(tp, dlopen_hybrid);
ATF_TP_ADD_TC(tp, dlopen_nocheri);
return atf_no_error();
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,36 +67,9 @@ ATF_TC_BODY(dlopen_hybrid_fail, tc)
test_dlopen_failure("libbasic_hybrid.so.0", error_msg);
}

ATF_TC(dlopen_nocheri_fail);
ATF_TC_HEAD(dlopen_nocheri_fail, tc)
{
atf_tc_set_md_var(tc, "descr",
"Check that dlopen() of a non-CHERI library from a purecap binary fails");
}
ATF_TC_BODY(dlopen_nocheri_fail, tc)
{
char error_msg[PATH_MAX];
const char* exedir = get_executable_dir();

#if defined(__riscv) || (__aarch64__)
/*
* RISC-V has no CHERI vs non-CHERI distinction in its flags (just like all
* extensions other than C, which influences linker relaxation). We
* therefore fall back on it not being purecap.
*/
snprintf(error_msg, sizeof(error_msg),
"%s/%s: cannot load %s/../%s since it is not CheriABI",
exedir, "dlopen-purecap", exedir, "libbasic_nocheri.so.0");
#else
#error "Unknown architecture"
#endif
test_dlopen_failure("libbasic_nocheri.so.0", error_msg);
}

ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, dlopen_purecap);
ATF_TP_ADD_TC(tp, dlopen_hybrid_fail);
ATF_TP_ADD_TC(tp, dlopen_nocheri_fail);
return atf_no_error();
}

0 comments on commit 6eeacd7

Please sign in to comment.