blob: 9ec8f3532b137d8db01ecf84d637ab0b7a1e0a38 [file] [log] [blame]
Pau Espin Pedrol150abb42018-03-08 17:27:35 +01001# osmo_gsm_tester: specifics pcu base abstract class
2#
3# Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH
4#
5# Author: Pau Espin Pedrol <pespin@sysmocom.de>
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20from abc import ABCMeta, abstractmethod
21from . import log
22
23class Pcu(log.Origin, metaclass=ABCMeta):
24 """PCU Abstract Base Class."""
Pau Espin Pedrol150abb42018-03-08 17:27:35 +010025
26##############
27# PROTECTED
28##############
29
30 def __init__(self, suite_run, bts, conf, name):
31 """Base constructor. Must be called by subclass."""
32 super().__init__(log.C_RUN, name)
33 self.suite_run = suite_run
34 self.bts = bts
35 self.conf = conf
36
37###################
38# PUBLIC (test API included)
39###################
40
41 @abstractmethod
Pau Espin Pedrolb1526b92018-05-22 20:32:30 +020042 def start(self, keepalive=False):
Pau Espin Pedrol150abb42018-03-08 17:27:35 +010043 """Start the PCU. Must be implemented by subclass."""
44 pass
45
Pau Espin Pedrol651cdc92018-03-08 20:53:13 +010046#------------------------------------------------------------------------------
47
48class PcuDummy(Pcu):
49 """PCU for BTS without proper PCU control"""
50
51 def __init__(self, suite_run, bts, conf):
52 super().__init__(suite_run, bts, conf, 'PcuDummy')
53
Pau Espin Pedrolb1526b92018-05-22 20:32:30 +020054 def start(self, keepalive=False):
Pau Espin Pedrol651cdc92018-03-08 20:53:13 +010055 pass
56
Pau Espin Pedrol150abb42018-03-08 17:27:35 +010057# vim: expandtab tabstop=4 shiftwidth=4