We will check out some examples from Testgres:
- We create the same two tests for our RDS, as follows:
root@devopsubuntu1804:~# mkdir /usr/local/src/testgres
root@devopsubuntu1804:~# nano /usr/local/src/testgres/atmrds.py
----------------------------------------------------------------
#!/usr/bin/env python
# coding: utf-8
import unittest
import logging
import testgres
logging.basicConfig(filename='/tmp/testgres.log')
class RdsTest(unittest.TestCase):
def test_bank_zipcode(self):
#create a node with random name, port, etc
with testgres.get_new_node() as node:
# RDS endpoint
node.host = 'atm.ck5074bwbilj.us-east-1.rds.amazonaws.com'
node.port = 5432
# run inidb
node.init()
with node.connect('atm', 'dba', 'bookdemo') as conn:
conn.begin('serializable')
# execute a query in the AWS RDS
data...