def test_init_configure (self): assert os.path.exists(CONFIG_FILE) system = Simulator() assert not system.partitions system = Simulator(config_file=CONFIG_FILE) assert system._partitions assert len(system._partitions) > 0
def setup(self): self.slp = TimingServiceLocator() self.system = Simulator(config_file="simulator.xml") self.system_thr = ComponentProgressThread(self.system) self.system_thr.start() self.scriptm = ScriptManager() self.scriptm_thr = ComponentProgressThread(self.scriptm) self.scriptm_thr.start() self.qm = QueueManager() self.qm_thr = ComponentProgressThread(self.qm) self.qm_thr.start()
def setup (self): TestComponent.setup(self) assert os.path.exists(CONFIG_FILE) self.system = Simulator(config_file=CONFIG_FILE) assert self.system._partitions assert len(self.system._partitions) > 0 part_names = self.system._partitions.keys() for part_name in part_names: partitions = self.system.add_partitions([{'name':part_name}]) assert len(partitions) == 1 partitions = self.system.set_partitions([{'tag':"partition", 'name':part_name}], {'functional':True, 'scheduled':True}) assert len(partitions) == 1 idle_partitions = self.system.get_partitions([{'state':"idle"}]) assert part_name in [p.name for p in idle_partitions] partition_sizes = [p.size for p in self.system._partitions.itervalues()] partition_sizes.sort() self.min_size = partition_sizes[0] self.median_size = partition_sizes[len(partition_sizes) / 2] self.max_size = partition_sizes[-1]
def test_configure (self): assert os.path.exists(CONFIG_FILE) system = Simulator() assert not system._partitions system.configure(CONFIG_FILE) assert system._partitions