| #!/bin/sh |
| |
| |
| |
| t_Log "Running $0 - python can retrieve mysql55-mysql-server version information." |
| |
| |
| |
| if [ $centos_ver = 5 ] |
| then |
| t_ServiceControl mysqld stop |
| t_ServiceControl mysql55-mysqld start |
| fi |
| |
| |
| t_InstallPackage MySQL-python |
| |
| |
| SCRIPT='/var/tmp/test.py' |
| |
| cat >$SCRIPT <<EOF |
| import MySQLdb |
| |
| conn = MySQLdb.connect (host = "localhost", |
| user = "", |
| passwd = "", |
| db = "test") |
| cursor = conn.cursor () |
| cursor.execute ("SELECT VERSION()") |
| row = cursor.fetchone () |
| print "server version:", row[0] |
| cursor.close () |
| conn.close () |
| EOF |
| |
| |
| python $SCRIPT |grep -q 'server version' |
| |
| t_CheckExitStatus $? |
| |
| |
| /bin/rm $SCRIPT |