Change in python/osmo-python-tests[master]: osmo_interact/common: ignore trailing empty lines in received results
Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10866 ) Change subject: osmo_interact/common: ignore trailing empty lines in received results .. Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1930868451c5738b17e318a9807590d948210b9a Gerrit-Change-Number: 10866 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 11 Sep 2018 00:41:45 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in python/osmo-python-tests[master]: osmo_interact/common: ignore trailing empty lines in received results
Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10866 ) Change subject: osmo_interact/common: ignore trailing empty lines in received results .. osmo_interact/common: ignore trailing empty lines in received results If the VTY/CTRL output contains trailing newlines, do not cause those to trigger mismatch errors, rather drop those. Rationale: in transcript scripts, the amount of empty lines between expected results is ignored, to allow cosmetically arranging into sections. So trailing newlines are dropped, and there is no way to preserve those. Change-Id: I1930868451c5738b17e318a9807590d948210b9a --- M osmopy/osmo_interact/common.py 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/osmopy/osmo_interact/common.py b/osmopy/osmo_interact/common.py index 31f44a8..39163a2 100644 --- a/osmopy/osmo_interact/common.py +++ b/osmopy/osmo_interact/common.py @@ -175,6 +175,10 @@ step.verify_interact_state(self) res = self.command(step.command) +# trailing empty lines in the command output cannot be preserved because we allow +# arbitrary newlines between commands. Do not even track these. +while res and not res[-1]: +res = res[:-1] if self.verbose: sys.stderr.flush() -- To view, visit https://gerrit.osmocom.org/10866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1930868451c5738b17e318a9807590d948210b9a Gerrit-Change-Number: 10866 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Neels Hofmeyr
Change in python/osmo-python-tests[master]: osmo_interact/common: ignore trailing empty lines in received results
Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10866 to look at the new patch set (#2). Change subject: osmo_interact/common: ignore trailing empty lines in received results .. osmo_interact/common: ignore trailing empty lines in received results If the VTY/CTRL output contains trailing newlines, do not cause those to trigger mismatch errors, rather drop those. Rationale: in transcript scripts, the amount of empty lines between expected results is ignored, to allow cosmetically arranging into sections. So trailing newlines are dropped, and there is no way to preserve those. Change-Id: I1930868451c5738b17e318a9807590d948210b9a --- M osmopy/osmo_interact/common.py 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/66/10866/2 -- To view, visit https://gerrit.osmocom.org/10866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1930868451c5738b17e318a9807590d948210b9a Gerrit-Change-Number: 10866 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102)
Change in python/osmo-python-tests[master]: osmo_interact/common: ignore trailing empty lines in received results
Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10866 ) Change subject: osmo_interact/common: ignore trailing empty lines in received results .. Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1930868451c5738b17e318a9807590d948210b9a Gerrit-Change-Number: 10866 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Comment-Date: Mon, 10 Sep 2018 14:56:57 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in python/osmo-python-tests[master]: osmo_interact/common: ignore trailing empty lines in received results
Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10866 Change subject: osmo_interact/common: ignore trailing empty lines in received results .. osmo_interact/common: ignore trailing empty lines in received results If the VTY/CTRL output contains trailing newlines, do not cause those to trigger mismatch errors, rather drop those. Rationale: in transcript scripts, the amount of empty lines between expected results is ignored, to allow cosmetically arranging into sections. So trailing newlines are dropped, and there is no way to preserve those. Change-Id: I1930868451c5738b17e318a9807590d948210b9a --- M osmopy/osmo_interact/common.py 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/66/10866/1 diff --git a/osmopy/osmo_interact/common.py b/osmopy/osmo_interact/common.py index 31f44a8..349051e 100644 --- a/osmopy/osmo_interact/common.py +++ b/osmopy/osmo_interact/common.py @@ -268,6 +268,10 @@ e += 1 g += 1 +# ignore final empty lines, we also strip empty lines from the expected string +while g < len(got) and not got[g]: +g += 1 + if g < len(got): return 'Did not expect line %r' % got[g] return True -- To view, visit https://gerrit.osmocom.org/10866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1930868451c5738b17e318a9807590d948210b9a Gerrit-Change-Number: 10866 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr