def test_features_crawler_crawl_outcontainer_cpu(self):
     c = DockerContainer(self.container['Id'])
     crawler = FeaturesCrawler(crawl_mode='OUTCONTAINER', container=c)
     for key, feature in crawler.crawl_cpu():
         print key, feature
     cores = len(list(crawler.crawl_cpu()))
     assert cores > 0
 def test_features_crawler_crawl_outcontainer_cpu(self):
     c = DockerContainer(self.container['Id'])
     crawler = FeaturesCrawler(crawl_mode='OUTCONTAINER', container=c)
     for key, feature in crawler.crawl_cpu():
         print key, feature
     cores = len(list(crawler.crawl_cpu()))
     assert cores > 0
def test_features_crawler_crawl_outcontainer_cpu():
    # Start a dummy container
    proc = subprocess.Popen(
            "docker run -d ubuntu sleep 60",
            shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    long_id = proc.stdout.read().strip()
    c = DockerContainer(long_id)
    
    crawler = FeaturesCrawler(crawl_mode='OUTCONTAINER', container=c)
    #for key, feature in crawler.crawl_cpu():
    #    print key, feature
    cores = len(list(crawler.crawl_cpu()))
    # Kill the dummy container
    proc = subprocess.Popen(
            "docker rm -f %s" % long_id,
            shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    long_id = proc.stdout.read().strip()
    assert cores > 0
    print sys._getframe().f_code.co_name, 1
 def test_features_crawler_crawl_invm_cpu(self):
     crawler = FeaturesCrawler(crawl_mode='INVM')
     cores = len(list(crawler.crawl_cpu()))
     assert cores > 0
 def test_features_crawler_crawl_invm_cpu(self):
     crawler = FeaturesCrawler(crawl_mode='INVM')
     cores = len(list(crawler.crawl_cpu()))
     assert cores > 0
def test_features_crawler_crawl_invm_cpu():
    crawler = FeaturesCrawler(crawl_mode='INVM')
    cores = len(list(crawler.crawl_cpu()))
    assert cores > 0
    print sys._getframe().f_code.co_name, 1