int main(int argc, char *argv[]) { A* a = new A(); B* b = new B(); C* c = new C(); D* d = new D(); E* e = new E(); test_A(a); test_B(b); test_C(c); test_D(d); test_E(e); std::cout << "--- Deleting ----" << std::endl; delete a; std::cout << "-----------------" << std::endl; delete b; std::cout << "-----------------" << std::endl; delete c; std::cout << "-----------------" << std::endl; delete d; std::cout << "-----------------" << std::endl; delete e; return 0; }
void test_syscall(int syscall) { //clear_log(); do_intercept(syscall, 0); do_as_guest("./test_full nonroot %d", syscall, 0); do_start(syscall, -2, -EINVAL); do_start(syscall, 0, 0); do_stop(syscall, 0, 0); do_start(syscall, 1, 0); do_as_guest("./test_full stop %d 1 %d", syscall, -EPERM); do_stop(syscall, 1, 0); do_as_guest("./test_full start %d -1 %d", syscall, 0); do_stop(syscall, last_child, -EINVAL); do_release(syscall, 0); puts("----- START OF test_PASS -----"); test_PASS(syscall); puts("----- END OF test_PASS -----"); puts("----- START OF test_A -----"); test_A(syscall); puts("----- END OF test_A -----"); puts("----- START OF test_B -----"); test_B(syscall, TRUE); puts("----- END OF test_B -----"); puts("----- START OF test_CDE ----"); test_CDE(syscall); puts("----- END OF test_CDE ----"); }
void test_D(D* d) { test_B(d); std::cout << "D----------------" << std::endl; d->f(); d->g(); d->h(); }
/* note this test is run after all processes have been intercepted*/ int do_nonroot(int syscall) { do_intercept(syscall, -EPERM); do_release(syscall, -EPERM); do_start(syscall, 0, -EPERM); do_stop(syscall, 0, -EPERM); do_start(syscall, 1, -EPERM); do_stop(syscall, 1, -EPERM); do_start(syscall, getpid(), 0); do_start(syscall, getpid(), -EBUSY); test_monitor(syscall, TRUE); do_stop(syscall, getpid(), 0); do_stop(syscall, getpid(), -EINVAL); puts("----- START OF test_B -----"); test_B(syscall, FALSE); puts("----- END OF test_B -----"); return 0; }
int main(int argc, char *argv[]) { int lucky = 42; printf("42 == %d\n", lucky); A* a = new A(); B* b = new B(); C* c = new C(); D* d = new D(); test_A(a); test_B(b); test_C(c); test_D(d); delete a; delete b; delete c; delete d; return 0; }
int main(int argc, char *argv[]) { A* a = new A(); B* b = new B(); C* c = new C(); D* d = new D(); E* e = new E(); test_A(a); test_B(b); test_C(c); test_D(d); test_E(e); delete a; delete b; delete c; delete d; delete e; return 0; }
void test_E(E* e) {test_B(e); test_D(e); e->f(); e->g(); e->h();}