File tree Expand file tree Collapse file tree 3 files changed +8
-18
lines changed
Expand file tree Collapse file tree 3 files changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -650,6 +650,7 @@ sgx_enclave_test(
650650 enclaves = {"enclave" : ":die.so" },
651651 test_args = [
652652 "--enclave_path='{enclave}'" ,
653+ "--loader_path=$(rootpath :double_die_host_bin)" ,
653654 ],
654655 deps = [
655656 "//asylo:enclave_client" ,
@@ -691,6 +692,7 @@ enclave_test(
691692 enclaves = {"enclave" : ":exception.so" },
692693 test_args = [
693694 "--enclave_path='{enclave}'" ,
695+ "--loader_path=$(rootpath :exception_app_host_bin)" ,
694696 ],
695697 deps = [
696698 ":exception" ,
@@ -701,7 +703,6 @@ enclave_test(
701703 "//asylo/test/util:test_main" ,
702704 "//asylo/util:logging" ,
703705 "//asylo/util:status" ,
704- "@bazel_tools//tools/cpp/runfiles" ,
705706 "@com_google_absl//absl/flags:flag" ,
706707 "@com_google_absl//absl/memory" ,
707708 "@com_google_absl//absl/strings" ,
Original file line number Diff line number Diff line change 2020
2121#include < gtest/gtest.h>
2222#include " absl/flags/flag.h"
23- #include " tools/cpp/runfiles/runfiles.h"
2423#include " asylo/test/util/enclave_test.h"
2524#include " asylo/test/util/exec_tester.h"
2625
27- using bazel::tools::cpp::runfiles::Runfiles;
26+ ABSL_FLAG (std::string, loader_path, " " , " Path to enclave loader" );
27+
2828
2929namespace asylo {
3030namespace {
3131
3232class DieTest : public ::testing::Test {
3333 public:
3434 void SetUp () override {
35- std::string error;
36- std::unique_ptr<Runfiles> runfiles (Runfiles::CreateForTest (&error));
37- ASSERT_NE (runfiles, nullptr ) << error;
38-
39- app_ = runfiles->Rlocation (
40- " com_google_asylo/asylo/test/misc/double_die_host_bin" );
35+ app_ = absl::GetFlag (FLAGS_loader_path);
4136 }
4237
4338 protected:
Original file line number Diff line number Diff line change 2222#include < gtest/gtest.h>
2323#include " absl/flags/flag.h"
2424#include " absl/strings/string_view.h"
25- #include " tools/cpp/runfiles/runfiles.h"
2625#include " asylo/test/util/enclave_test.h" // enclave_path
2726#include " asylo/test/util/exec_tester.h"
2827
29- using bazel::tools::cpp::runfiles::Runfiles ;
28+ ABSL_FLAG (std::string, loader_path, " " , " Path to loader binary " ) ;
3029
3130namespace asylo {
3231namespace {
@@ -35,14 +34,9 @@ class ExceptionTest : public ::testing::Test {
3534 protected:
3635 // Return the status of the test subprocess.
3736 void RunTest (const std::string &input, int *status) {
38- std::string error;
39- std::unique_ptr<Runfiles> runfiles (Runfiles::CreateForTest (&error));
40- ASSERT_NE (runfiles, nullptr ) << error;
41-
42- std::string path = runfiles->Rlocation (
43- " com_google_asylo/asylo/test/misc/exception_app_host_bin" );
4437 experimental::ExecTester test ({
45- path, absl::GetFlag (FLAGS_enclave_path), input});
38+ absl::GetFlag (FLAGS_loader_path),
39+ absl::GetFlag (FLAGS_enclave_path), input});
4640 ASSERT_TRUE (test.Run (" " , status));
4741 }
4842};
You can’t perform that action at this time.
0 commit comments