Skip to content

Comments

Improved dotests.sh output #1641

Merged
ddpbsd merged 1 commit intoossec:masterfrom
jubois:improve-dotests.sh-output
Jan 21, 2019
Merged

Improved dotests.sh output #1641
ddpbsd merged 1 commit intoossec:masterfrom
jubois:improve-dotests.sh-output

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.

@jubois jubois force-pushed the improve-dotests.sh-output branch from af75380 to 48efa6d Compare January 18, 2019 07:57
    - 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.
@jubois jubois force-pushed the improve-dotests.sh-output branch from e9a933c to e643ba4 Compare January 18, 2019 08:12
@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.

2 participants