Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved dotests.sh output #1641

Merged
merged 1 commit into from
Jan 21, 2019
Merged

Conversation

jubois
Copy link
Contributor

@jubois jubois commented Jan 16, 2019

  • Changed output to diff --side-by-side style
  • Runs all tests and set exit code to 0 only if all tests passed (else 1)

cat tmpres
echo "** ERROR: Exiting."
echo "== DIFF OUTPUT (reference | new): =="
diff -Nay $idir/res tmpres
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My diff doesn't have a -y flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked with the virtual ossec appliance and the -y exists...
What is your distribution ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenBSD in this case. I haven't checked others.

    - Remove use of -y option in diff command (OpenBSD -y does not
    support it)
    - Force input as text for grep (-a opton)
    - use a cleanup function to restore hostname and remove tmpres when
    the script exits or is interrupted.
    - use --color option of diff if it is supported.
@ddpbsd ddpbsd merged commit 168dc7f into ossec:master Jan 21, 2019
@ddpbsd
Copy link
Member

ddpbsd commented Jan 21, 2019

It doesn't work on OpenBSD anyway. I'll have to peek at that later. Thanks for the updates!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants