-
Notifications
You must be signed in to change notification settings - Fork 25
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
MDBF-807 - Setup for PAM tests in buildbot #600
base: dev
Are you sure you want to change the base?
Conversation
RazvanLiviuVarzaru
commented
Oct 22, 2024
•
edited
Loading
edited
- configure install builders to perform PAM tests. RPM and DEB.
- migrate pam test script from old - bb:
- no need to create a new user. We have buildbot user.
- PAM v1 & v2 are configured and the auth is tested with the buildbot user.
- the user should not be able to login after the plugin is uninstalled
- perform MTR pam test in suite=plugins
5c201f3
to
8bed003
Compare
- configure install builders to perform PAM tests. RPM and DEB. - migrate pam test script from old - bb: - no need to create a new user. We have buildbot user. - PAM v1 & v2 are configured and the auth is tested with the buildbot user. - the user should not be able to login after the plugin is uninstalled - perform MTR pam test in suite=plugins
8bed003
to
c7978a9
Compare
# MTR | ||
#---------------- | ||
|
||
cd /usr/share/mysql-test || cd /usr/share/mariadb-test || cd /usr/share/mysql/mysql-test || cd /usr/share/mariadb/mariadb-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm this is confusing an does not look clean, what about something like:
# PATH can differ between MariaDB versions and distros
for db in mysql mariadb; do
for dir in \
/usr/share/$db-test \
/usr/share/$db/$db-test; do
[[ -d "$dir" ]] && cd "$dir"
done
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll try it out. Much cleaner, thanks!
|
||
cd /usr/share/mysql-test || cd /usr/share/mariadb-test || cd /usr/share/mysql/mysql-test || cd /usr/share/mariadb/mariadb-test | ||
|
||
if test -f suite/plugins/pam/pam_mariadb_mtr.so; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old syntax and not efficient, use bash builtin commands:
if [[ -f suite/plugins/pam/pam_mariadb_mtr.so ]]; then
[...]
fi
See: https://google.github.io/styleguide/shellguide.html#test----and---
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will fix!
|
||
if test -f suite/plugins/pam/pam_mariadb_mtr.so; then | ||
for p in /lib*/security /lib*/*/security ; do | ||
test -f "$p/pam_unix.so" && sudo cp -v suite/plugins/pam/pam_mariadb_mtr.so "$p"/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment:
[[ -f "$p/pam_unix.so" ]] && sudo cp -v suite/plugins/pam/pam_mariadb_mtr.so "$p"/
|
||
set +e | ||
|
||
if [ "$res" != "0" ] ; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Numerical comparison is done with the following:
if ((res != 0)); then
[...]
fi
see: https://google.github.io/styleguide/shellguide.html#testing-strings
However, be careful when using < and > in [[ … ]] which performs a lexicographical comparison. Use (( … )) or -lt and -gt for numerical comparison.