How to run cryptdb with test? - postgresql

I want to run cryptdb onpostgres,The third run method, Test, seems to work,but ,i don't konw how to run it.
III. Tests
> To Start:
obj/test/test queries plain proxy-single
What are the following parameters and how can they be run?

Related

Testing database creation in docker

I have a script creates my database (script with all required DDL and inserts). My goal is to test that script is correct and database will be created successfully and without exceptions.
I decide to use for this docker image "postgres:latest".
My question is: can I run the docker image so that my script will be applied (I know, I can run my cript by copying to /docker-entrypoint-initdb.d/), and immedietly after that database will be shutdown and docker container exit with code 0. I want to shutdown database for automation this process and check exit code in test script.
I'll be glad to other suggestions of automation the prosess.

GCloud Compute Project-Info Add-Metadata Hangs

The following command doesn't exit on my system:
gcloud compute project-info add-metadata --metadata=itemname=itemvalue
I am using powershell on windows, and I've also tested on a linux container in docker. In both environments, the metadata is updated, but the command never terminates.
If I provide an invalid key, or update to the existing value, I do get the output: No change requested; skipping update for [project]. and the program exits. Performing an actual update produces the hang.
I need this command to terminate so that I can use it in a script. I would like to be able to check the exit code to ensure the update occurred successfully.
You aren't patient enough. In large projects, this operation can take significant time to process. Give the script several minutes to complete.

How to run standard command-line command inside Laravel console command

I need to run an rsync command from inside a Laravel 5.2 console command, this may seem pretty obvious, but how can I do that?
The idea is to connect to one of my servers and get a copy of a directory and save it locally in my laravel storage directory.
I want it on a console command because I want to schedule it to run daily.
Thanks to the guys over at Laracasts, there was a simple solutions to this.
You just put the command inside exec() function.
https://laracasts.com/discuss/channels/laravel/how-to-run-an-rsync-command-inside-a-laravel-console-command

Run Evolutions in Command Line

It's my first day tinkering with the Play framework, and I'm having a hard time with evolutions. I'm using Play 2.4.
I picked a sample app from the many that come up in activator ui, it uses play-slick and play-slick-evolutions for DB connection and evolutions.
I've perused the docs, but I can't seem to find a way to run the evolutions from the command line. When I run activator on bash I get thrown into a shell, and the help doesn't bring up anything about running evolutions, or slick.
I've been doing PHP for a while, so I'm used to being able to run these up/down from the command line. I can drop the tables from the database client and do activator run which should prompt me to run the evolutions, but I'm looking for the right, manual way to do this. I imagine it's possible since it would need to be done on deploy.
As far as I know, they are not designed to be run manually. In development, Play asks you to run them:
In Production I trigger the evolutions by starting my server with the parameter -DapplyEvolutions.default=true. You can write this (without -D of course) also to the application.conf-file to run them always. You can also use only the down- or up-evolutions with -DapplyUpEvolutions.default=true or -DapplyDownEvolutions.default=true.
And of course there is always the option to just copy the part of the script you need manually and apply it with your favorite database tool. However, you then need to tell Play what you did by manually altering the table play_evolutions. An easier solution then would be to not use the evolutions mechanism provided by the Play Framework at all.
A quick hack that works for me and doesn't involve bringing up a play instance:
export PGPASSWORD=<password>
for SQL_FILE in $(ls <path-to-evolution-files>); do
psql -h localhost -U <username> -c "$(sed '1,/Ups/d' <path-to-evolution-files>/$SQL_FILE | sed -n '/Downs/q;p')";
done
Removes everything up to and include Ups and everything after and including Downs, and runs the commands on the Postgres instance.

Which database is used when play test?

My application.conf:
### default #conf/evolutions/default/1.sql
db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://localhost/test"
### test #conf/evolutions/test/1.sql
db.test.driver=org.h2.Driver
db.test.url="jdbc:h2:mem:play"
I run run command in play console, is db.default used?
When I run test command in play console, is still db.default used? How can I use db.test when I run test?
And when will conf/evolutions/default/1.sql and #conf/evolutions/test/1.sql be executed?
It will use the default database. Specifying the environment in the parameter key was a Play1 specific feature.