-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add product tests for file password authenticator plugin #1913
Conversation
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.
Reviewed two last commits
fi | ||
run_in_application_runner_container \ | ||
bash -c "export PRESTO_PASSWORD=$password; | ||
/docker/volumes/conf/docker/files/presto-cli.sh --execute 'SHOW CATALOGS' | grep -iq hive" |
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.
I think PRESTO_PASSWORD should be handled inside /docker/volumes/conf/docker/files/presto-cli.sh
otherwise things like ./bin/run_presto_cli_on_docker.sh
are not going to work for this environment.
I would add PRESTO_PASSWORD
env variable to presto-product-tests/conf/docker/fileauth/docker-compose.yml
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.
there is no need to change presto-cli.sh
I would add PRESTO_PASSWORD env variable to presto-product-tests/conf/docker/fileauth/docker-compose.yml
this should suffice
@@ -89,6 +94,10 @@ if [[ ! -f "$DOCKER_CONF_LOCATION/$ENVIRONMENT/compose.sh" ]]; then | |||
usage | |||
fi | |||
|
|||
if [[ "$ENVIRONMENT" == "fileauth" ]]; then | |||
CLI_ARGUMENTS="--server https://presto-master:8443 --user userCrypt --password --truststore-path /etc/ldap/cacerts.jks --truststore-password testldap" |
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.
define this in presto-product-tests/conf/docker/fileauth/docker-compose.yml
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.
it's already there e61633d#diff-26231eb27080877fabe76bdf699c4e39R14
so should be enough to remove it from here
if [ -f "$fileAuthCopy" ]; then | ||
rm -f $fileAuthCopy | ||
fi | ||
cp /docker/volumes/conf/presto/etc/file_auth $fileAuthCopy |
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.
I think it would be easier to use volume in presto-product-tests/conf/docker/fileauth/docker-compose.yml
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.
can we have volume with copy-on-write semantics?
(the file is being modified in the PrestoCliFileAuthTests.testAuthTokenCacheUpdate
test)
btw, do we need PrestoCliFileAuthTests.testAuthTokenCacheUpdate()
as a product test? i think unit test would be sufficient for this
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.
@electrum Shall we get rid of this test? This will also resolve the "file_auth_copy" issues.
@@ -0,0 +1,2 @@ | |||
userPBKDF2:1000:5b4240333032306164:f38d165fce8ce42f59d366139ef5d9e1ca1247f0e06e503ee1a611dd9ec40876bb5edb8409f5abe5504aab6628e70cfb3d3a18e99d70357d295002c3d0a308a0 |
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.
why do we need to copy this?
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.
ie remove the _copy
from the repo
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.
I created a copy and use it in the tests to avoid duplicate entries in case of product test failures.
For example, if the product test fails just after adding in the original file (the delete part is not executed), during the next run the add part will again add the same entries leading to duplicate entries.
@@ -0,0 +1,2 @@ | |||
userPBKDF2:1000:5b4240333032306164:f38d165fce8ce42f59d366139ef5d9e1ca1247f0e06e503ee1a611dd9ec40876bb5edb8409f5abe5504aab6628e70cfb3d3a18e99d70357d295002c3d0a308a0 | |||
userBCrypt:$2y$10$BqTb8hScP5DfcpmHo5PeyugxHz5Ky/qf3wrpD7SNm8sWuA3VlGqsa |
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.
how about having this file under presto-product-tests/conf/docker/fileauth/presto-master/etc/presto/file_auth
and the using docker volume in presto-product-tests/conf/docker/fileauth/docker-compose.yml
?
@@ -0,0 +1,24 @@ | |||
# |
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 comments like for presto-product-tests/conf/presto/etc/file_auth. See #1766
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.
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.
What do you mean? In general #1766 should not affect tests, but it is more about tests infra (file locations etc)
@@ -0,0 +1,3 @@ | |||
password-authenticator.name=file |
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 as above
http-server.https.enabled=true | ||
http-server.https.keystore.path=/etc/openldap/certs/coordinator.jks | ||
http-server.https.keystore.key=testldap | ||
http-server.authentication.type=PASSWORD |
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.
missing new line before EOF (same for other files)
@Override | ||
public Requirement getRequirements(Configuration configuration) | ||
{ | ||
return compose(immutableTable(NATION)); |
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.
compose
looks unnecessary
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.
Yes. Need to remove this.
fi | ||
run_in_application_runner_container \ | ||
bash -c "export PRESTO_PASSWORD=$password; | ||
/docker/volumes/conf/docker/files/presto-cli.sh --execute 'SHOW CATALOGS' | grep -iq hive" |
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.
there is no need to change presto-cli.sh
I would add PRESTO_PASSWORD env variable to presto-product-tests/conf/docker/fileauth/docker-compose.yml
this should suffice
@@ -89,6 +94,10 @@ if [[ ! -f "$DOCKER_CONF_LOCATION/$ENVIRONMENT/compose.sh" ]]; then | |||
usage | |||
fi | |||
|
|||
if [[ "$ENVIRONMENT" == "fileauth" ]]; then | |||
CLI_ARGUMENTS="--server https://presto-master:8443 --user userCrypt --password --truststore-path /etc/ldap/cacerts.jks --truststore-password testldap" |
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.
it's already there e61633d#diff-26231eb27080877fabe76bdf699c4e39R14
so should be enough to remove it from here
if [ -f "$fileAuthCopy" ]; then | ||
rm -f $fileAuthCopy | ||
fi | ||
cp /docker/volumes/conf/presto/etc/file_auth $fileAuthCopy |
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.
can we have volume with copy-on-write semantics?
(the file is being modified in the PrestoCliFileAuthTests.testAuthTokenCacheUpdate
test)
btw, do we need PrestoCliFileAuthTests.testAuthTokenCacheUpdate()
as a product test? i think unit test would be sufficient for this
@@ -0,0 +1,2 @@ | |||
userPBKDF2:1000:5b4240333032306164:f38d165fce8ce42f59d366139ef5d9e1ca1247f0e06e503ee1a611dd9ec40876bb5edb8409f5abe5504aab6628e70cfb3d3a18e99d70357d295002c3d0a308a0 |
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.
ie remove the _copy
from the repo
@@ -0,0 +1,9 @@ | |||
databases: | |||
hive: | |||
host: hadoop-master |
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.
redundant, default
hive: | ||
host: hadoop-master | ||
presto: | ||
host: presto-master |
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.
redundant, default
however, don't you need to use presto-master.docker.cluster
here, like other product tests with SSL do?
host: hadoop-master | ||
presto: | ||
host: presto-master | ||
configured_hdfs_user: hive |
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.
redundant, default
Which product test suite runs these tests? |
presto-product-tests/bin/run_on_docker.sh fileauth -t io.prestosql.tests.cli.PrestoCliFileAuthTests 2019-10-11 06:14:14 INFO: Completed 6 tests |
Is |
This is all of #1912 plus product tests.
Only the product tests commit should be reviewed in this PR.