Tests: lttngtest: raise NotImplementedError in abstract class methods
[lttng-tools.git] / tests / utils / lttngtest / lttngctl.py
index 9b9658ec626086ef280d8acc9ff19c26894f60d0..2595c6eb473a1ba48919866645ad159b3dfd9a22 100644 (file)
@@ -89,6 +89,17 @@ class TracingDomain(enum.Enum):
         return "<%s.%s>" % (self.__class__.__name__, self.name)
 
 
+@enum.unique
+class BufferSharingPolicy(enum.Enum):
+    """Buffer sharing policy."""
+
+    PerUID = "Per-UID buffering"
+    PerPID = "Per-PID buffering"
+
+    def __repr__(self):
+        return "<%s.%s>" % (self.__class__.__name__, self.name)
+
+
 class EventRule(abc.ABC):
     """Event rule base class, see LTTNG-EVENT-RULE(7)."""
 
@@ -193,24 +204,24 @@ class Channel(abc.ABC):
     @abc.abstractmethod
     def add_context(self, context_type):
         # type: (ContextType) -> None
-        pass
+        raise NotImplementedError
 
     @property
     @abc.abstractmethod
     def domain(self):
         # type: () -> TracingDomain
-        pass
+        raise NotImplementedError
 
     @property
     @abc.abstractmethod
     def name(self):
         # type: () -> str
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def add_recording_rule(self, rule) -> None:
         # type: (Type[EventRule]) -> None
-        pass
+        raise NotImplementedError
 
 
 class SessionOutputLocation(abc.ABC):
@@ -264,72 +275,72 @@ class ProcessIDProcessAttributeTracker(ProcessAttributeTracker):
     @abc.abstractmethod
     def track(self, pid):
         # type: (int) -> None
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def untrack(self, pid):
         # type: (int) -> None
-        pass
+        raise NotImplementedError
 
 
 class VirtualProcessIDProcessAttributeTracker(ProcessAttributeTracker):
     @abc.abstractmethod
     def track(self, vpid):
         # type: (int) -> None
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def untrack(self, vpid):
         # type: (int) -> None
-        pass
+        raise NotImplementedError
 
 
 class UserIDProcessAttributeTracker(ProcessAttributeTracker):
     @abc.abstractmethod
     def track(self, uid):
         # type: (Union[int, str]) -> None
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def untrack(self, uid):
         # type: (Union[int, str]) -> None
-        pass
+        raise NotImplementedError
 
 
 class VirtualUserIDProcessAttributeTracker(ProcessAttributeTracker):
     @abc.abstractmethod
     def track(self, vuid):
         # type: (Union[int, str]) -> None
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def untrack(self, vuid):
         # type: (Union[int, str]) -> None
-        pass
+        raise NotImplementedError
 
 
 class GroupIDProcessAttributeTracker(ProcessAttributeTracker):
     @abc.abstractmethod
     def track(self, gid):
         # type: (Union[int, str]) -> None
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def untrack(self, gid):
         # type: (Union[int, str]) -> None
-        pass
+        raise NotImplementedError
 
 
 class VirtualGroupIDProcessAttributeTracker(ProcessAttributeTracker):
     @abc.abstractmethod
     def track(self, vgid):
         # type: (Union[int, str]) -> None
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def untrack(self, vgid):
         # type: (Union[int, str]) -> None
-        pass
+        raise NotImplementedError
 
 
 class Session(abc.ABC):
@@ -342,39 +353,49 @@ class Session(abc.ABC):
     @abc.abstractmethod
     def name(self):
         # type: () -> str
-        pass
+        raise NotImplementedError
 
     @property
     @abc.abstractmethod
     def output(self):
         # type: () -> Optional[Type[SessionOutputLocation]]
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
-    def add_channel(self, domain, channel_name=None):
-        # type: (TracingDomain, Optional[str]) -> Channel
+    def add_channel(
+        self,
+        domain,
+        channel_name=None,
+        buffer_sharing_policy=BufferSharingPolicy.PerUID,
+    ):
+        # type: (TracingDomain, Optional[str], BufferSharingPolicy) -> Channel
         """Add a channel with default attributes to the session."""
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def start(self):
         # type: () -> None
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def stop(self):
         # type: () -> None
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def destroy(self):
         # type: () -> None
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def is_active(self):
         # type: () -> bool
-        pass
+        raise NotImplementedError
+
+    @abc.abstractmethod
+    def rotate(self):
+        # type: () -> None
+        raise NotImplementedError
 
     @abc.abstractproperty
     def kernel_pid_process_attribute_tracker(self):
@@ -446,7 +467,7 @@ class Controller(abc.ABC):
         Create a session with an output. Don't specify an output
         to create a session without an output.
         """
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def start_session_by_name(self, name):
@@ -454,7 +475,7 @@ class Controller(abc.ABC):
         """
         Start a session by name.
         """
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def start_session_by_glob_pattern(self, pattern):
@@ -462,7 +483,7 @@ class Controller(abc.ABC):
         """
         Start sessions whose name matches `pattern`, see GLOB(7).
         """
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def start_sessions_all(self):
@@ -470,7 +491,7 @@ class Controller(abc.ABC):
         Start all sessions visible to the current user.
         """
         # type: () -> None
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def stop_session_by_name(self, name):
@@ -478,7 +499,7 @@ class Controller(abc.ABC):
         """
         Stop a session by name.
         """
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def stop_session_by_glob_pattern(self, pattern):
@@ -486,7 +507,7 @@ class Controller(abc.ABC):
         """
         Stop sessions whose name matches `pattern`, see GLOB(7).
         """
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def stop_sessions_all(self):
@@ -494,7 +515,7 @@ class Controller(abc.ABC):
         Stop all sessions visible to the current user.
         """
         # type: () -> None
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def destroy_session_by_name(self, name):
@@ -502,7 +523,7 @@ class Controller(abc.ABC):
         """
         Destroy a session by name.
         """
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def destroy_session_by_glob_pattern(self, pattern):
@@ -510,7 +531,7 @@ class Controller(abc.ABC):
         """
         Destroy sessions whose name matches `pattern`, see GLOB(7).
         """
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def destroy_sessions_all(self):
@@ -518,7 +539,7 @@ class Controller(abc.ABC):
         """
         Destroy all sessions visible to the current user.
         """
-        pass
+        raise NotImplementedError
 
     @abc.abstractmethod
     def list_sessions(self):
@@ -526,4 +547,28 @@ class Controller(abc.ABC):
         """
         List all sessions visible to the current user.
         """
-        pass
+        raise NotImplementedError
+
+    @abc.abstractmethod
+    def rotate_session_by_name(self, name, wait=True):
+        # type: (str, bool) -> None
+        """
+        Rotate a session
+        """
+        raise NotImplementedError
+
+    @abc.abstractmethod
+    def schedule_size_based_rotation(self, name, size_bytes):
+        # type: (str, int) -> None
+        """
+        Schedule automatic size-based rotations.
+        """
+        raise NotImplementedError
+
+    @abc.abstractmethod
+    def schedule_time_based_rotation(self, name, period_seconds):
+        # type: (str, int) -> None
+        """
+        Schedule automatic time-based rotations.
+        """
+        raise NotImplementedError
This page took 0.028565 seconds and 4 git commands to generate.