summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/testing/user/userguide/conf.py29
-rw-r--r--nfvbench/compute.py2
-rw-r--r--nfvbench/config.py14
-rw-r--r--test/test_nfvbench.py8
4 files changed, 30 insertions, 23 deletions
diff --git a/docs/testing/user/userguide/conf.py b/docs/testing/user/userguide/conf.py
index 638764c..020533c 100644
--- a/docs/testing/user/userguide/conf.py
+++ b/docs/testing/user/userguide/conf.py
@@ -20,8 +20,8 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
-import sys
from pbr import version as pbr_ver
+import sys
sys.path.insert(0, os.path.abspath('../..'))
@@ -118,13 +118,12 @@ pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
-
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
-#html_theme = 'haiku'
+# html_theme = 'haiku'
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
@@ -244,21 +243,21 @@ htmlhelp_basename = 'NFVBenchdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
- # The paper size ('letterpaper' or 'a4paper').
- #
- # 'papersize': 'letterpaper',
+ # The paper size ('letterpaper' or 'a4paper').
+ #
+ # 'papersize': 'letterpaper',
- # The font size ('10pt', '11pt' or '12pt').
- #
- # 'pointsize': '10pt',
+ # The font size ('10pt', '11pt' or '12pt').
+ #
+ # 'pointsize': '10pt',
- # Additional stuff for the LaTeX preamble.
- #
- # 'preamble': '',
+ # Additional stuff for the LaTeX preamble.
+ #
+ # 'preamble': '',
- # Latex figure (float) alignment
- #
- # 'figure_align': 'htbp',
+ # Latex figure (float) alignment
+ #
+ # 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
diff --git a/nfvbench/compute.py b/nfvbench/compute.py
index c8ec383..681a852 100644
--- a/nfvbench/compute.py
+++ b/nfvbench/compute.py
@@ -90,7 +90,7 @@ class Compute(object):
def delete_image(self, img_name):
try:
LOG.log("Deleting image %s...", img_name)
- img = self.glance_client.images.find(name=img_name)
+ img = self.find_image(image_name=img_name)
self.glance_client.images.delete(img.id)
except Exception:
LOG.error("Failed to delete the image %s.", img_name)
diff --git a/nfvbench/config.py b/nfvbench/config.py
index 2a67b7e..a0587b6 100644
--- a/nfvbench/config.py
+++ b/nfvbench/config.py
@@ -49,17 +49,21 @@ def config_loads(cfg_text, from_cfg=None):
def get_err_config(subset, superset):
+ result = {}
for k, v in subset.items():
if k not in superset:
- return {k: v}
- if v is not None and superset[k] is not None:
+ result.update({k: v})
+ elif v is not None and superset[k] is not None:
if not isinstance(v, type(superset[k])):
- return {k: v}
+ result.update({k: v})
+ continue
if isinstance(v, dict):
res = get_err_config(v, superset[k])
if res:
- return {k: res}
- return None
+ result.update({k: res})
+ if not result:
+ return None
+ return result
def test_config():
diff --git a/test/test_nfvbench.py b/test/test_nfvbench.py
index a220703..a70e71a 100644
--- a/test/test_nfvbench.py
+++ b/test/test_nfvbench.py
@@ -648,7 +648,11 @@ def test_config():
assert(get_err_config({3: "abc"}, refcfg) is None)
# correctly fails
assert(get_err_config({4: 0}, refcfg) == {4: 0})
- assert(get_err_config({2: {0: 1, 1: 2}}, refcfg) == {2: {0: 1}})
+ assert(get_err_config({2: {21: 100, 30: 50}}, refcfg) == {2: {30: 50}})
+ assert(get_err_config({2: {0: 1, 1: 2}}, refcfg) == {2: {0: 1, 1: 2}})
+ assert(get_err_config({2: {0: 1, 1: 2}, 5: 5}, refcfg) == {2: {0: 1, 1: 2}, 5: 5})
# invalid value type
assert(get_err_config({1: 'abc', 2: {21: 0}}, refcfg) == {1: 'abc'})
- assert(get_err_config({2: 100, 5: 10}, refcfg) == {2: 100})
+ assert(get_err_config({2: 100}, refcfg) == {2: 100})
+ # both correctly fail and invalid value type
+ assert(get_err_config({2: 100, 5: 10}, refcfg) == {2: 100, 5: 10})
='n344' href='#n344'>344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517