| 673 | { |
| 674 | public: |
| 675 | NetClsCgroupsFilter() |
| 676 | { |
| 677 | netClsError = true; |
| 678 | #ifdef __linux__ |
| 679 | Try<bool> netCls = cgroups::enabled("net_cls"); |
| 680 | |
| 681 | if (netCls.isError()) { |
| 682 | std::cerr |
| 683 | << "-------------------------------------------------------------\n" |
| 684 | << "Cannot enable net_cls cgroup subsystem associated test cases \n" |
| 685 | << "since we cannot determine the existence of the net_cls cgroup\n" |
| 686 | << "subsystem.\n" |
| 687 | << "-------------------------------------------------------------\n"; |
| 688 | return; |
| 689 | } |
| 690 | |
| 691 | if (netCls.isSome() && !netCls.get()) { |
| 692 | std::cerr |
| 693 | << "-------------------------------------------------------------\n" |
| 694 | << "Cannot enable net_cls cgroup subsystem associated test cases \n" |
| 695 | << "since net_cls cgroup subsystem is not enabled. Check instructions\n" |
| 696 | << "for your linux distrubtion to enable the net_cls cgroup subsystem\n" |
| 697 | << "on your system.\n" |
| 698 | << "-----------------------------------------------------------\n"; |
| 699 | return; |
| 700 | } |
| 701 | netClsError = false; |
| 702 | #else |
| 703 | std::cerr |
| 704 | << "-----------------------------------------------------------\n" |
| 705 | << "Cannot enable net_cls cgroup subsystem associated test cases\n" |
| 706 | << "since this platform does not support cgroups.\n" |
| 707 | << "-----------------------------------------------------------\n"; |
| 708 | #endif |
| 709 | } |
| 710 | |
| 711 | bool disable(const ::testing::TestInfo* test) const override |
| 712 | { |