Skip to content

Commit

Permalink
update test: delay assertion
Browse files Browse the repository at this point in the history
Change-Id: Ie58f17ab6c0accb58ea7c08da972058837442973
  • Loading branch information
mo-ki authored and MatteoStifano committed Oct 23, 2023
1 parent 6effa8d commit 498aa99
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/testlib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import livestatus

from cmk.utils.paths import counters_dir, piggyback_dir, piggyback_source_dir
from cmk.utils.version import Edition
from cmk.utils.version import Edition, Version

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -1505,10 +1505,18 @@ def interactive_update(
with open(logfile_path) as logfile:
logger.debug("OMD automation logfile: %s", logfile.read())

# tmpfs should have been restored:
assert os.path.exists(site.path(counters_dir))
assert os.path.exists(site.path(str(piggyback_dir)))
assert os.path.exists(site.path(str(piggyback_source_dir)))
# restoring the tmpfs was broken and has been fixed with
# 3448a7da56ed6d4fa2c2f425d0b1f4b6e02230aa
from_version = Version.from_str(test_site.version.version)
if (
(Version.from_str("2.1.0p36") <= from_version < Version.from_str("2.2.0"))
or (Version.from_str("2.2.0p13") <= from_version < Version.from_str("2.3.0"))
or Version.from_str("2.3.0b1") <= from_version
):
# tmpfs should have been restored:
assert os.path.exists(site.path(counters_dir))
assert os.path.exists(site.path(str(piggyback_dir)))
assert os.path.exists(site.path(str(piggyback_source_dir)))

# refresh the site object after creating the site
self._base_ident = ""
Expand Down

0 comments on commit 498aa99

Please sign in to comment.