Skip to content

Commit

Permalink
Merge pull request #193 from lars-t-hansen/w-192-user-names
Browse files Browse the repository at this point in the history
Fix #192 - user names may contain dashes
  • Loading branch information
lars-t-hansen authored Oct 7, 2024
2 parents ee753b1 + a7f2a60 commit d636b16
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/ps-syntax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# - check that at least one line is produced
# - the line starts with `v=` with a sensible version syntax
# - there is a `host=$HOSTNAME` field
# - there is a `user=` field with a plausible string
# - there is a `user=` field with a plausible string (note bug 192, may contain "-")
# - there is a `cmd=` field
#
# We don't have the infra at the moment to check the CSV output (cf sysinfo-syntax.sh where we use
Expand All @@ -22,19 +22,19 @@ if [[ $count -le 0 ]]; then
fi
l=$(head -n 1 <<< $output)
if [[ !( $l =~ ^v=[0-9]+\.[0-9]+\.[0-9], ) ]]; then
echo "Version missing"
echo "Version missing, got $l"
exit 1
fi
if [[ !( $l =~ ,user=[a-z0-9]+, ) ]]; then
echo "User missing"
if [[ !( $l =~ ,user=[-a-z0-9]+, ) ]]; then
echo "User missing, got $l"
exit 1
fi
# The command may be quoted so match only the beginning
if [[ !( $l =~ ,\"?cmd= ) ]]; then
echo "Cmd missing"
echo "Cmd missing, got $l"
exit 1
fi
if [[ !( $l =~ ,host=$HOSTNAME, ) ]]; then
echo "Host missing"
echo "Host missing, got $l"
exit 1
fi

0 comments on commit d636b16

Please sign in to comment.