MCPcopy Create free account
hub / github.com/ceph/ceph / test_pg_logging

Function test_pg_logging

qa/tasks/ceph_objectstore_tool.py:580–611  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

578
579 @SKIP_IF_CRIMSON("PG logging not implemented")
580 def test_pg_logging():
581 local_errors = 0
582 log.info("Test pg logging")
583 for remote in osds.remotes.keys():
584 for role in osds.remotes[remote]:
585 if not role.startswith("osd."):
586 continue
587 osdid = int(role.split('.')[1])
588 if osdid not in pgs:
589 continue
590
591 for pg in pgs[osdid]:
592 cmd = ((prefix + "--op log --pgid {pg}").
593 format(id=osdid, pg=pg).split())
594 try:
595 output = remote.sh(cmd, wait=True)
596 except CommandFailedError as e:
597 log.error("Getting log failed for pg {pg} "
598 "from osd.{id} with {ret}".
599 format(pg=pg, id=osdid, ret=e.exitstatus))
600 local_errors += 1
601 continue
602 HASOBJ = pg in pgswithobjects
603 MODOBJ = "modify" in output
604 if HASOBJ != MODOBJ:
605 log.error("Bad log for pg {pg} from osd.{id}".
606 format(pg=pg, id=osdid))
607 MSG = (HASOBJ and [""] or ["NOT "])[0]
608 log.error("Log should {msg}have a modify entry".
609 format(msg=MSG))
610 local_errors += 1
611 return local_errors
612
613 ERRORS += test_pg_logging()
614

Callers 1

test_objectstoreFunction · 0.85

Calls 5

infoMethod · 0.45
keysMethod · 0.45
splitMethod · 0.45
formatMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected