Beispiel #1
0
    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]
Beispiel #2
0
 def setup (self):
     TestComponent.setup(self)
     self.slp = ServiceLocator()