示例#1
0
文件: fault.py 项目: LJoNe/gpdb
    def test_drop_db(self):
        ''' Test to Simulate drop_db  when database dir is offline '''
        newfault = Fault()
        sleep(20)
        #Get segment host, data dir, and DB oid to create fault
        (hostname, dirloc, oid) =  newfault.get_host_dir_oid()

        # Move database dir to take it offline
        fromDir = dirloc + '/base/'+ oid
        toDir = dirloc + '/base/../../'
        newfault.move_dir(hostname, fromDir, toDir)                
        newfault.drop_db()

        #restore database dir
        fromDir = dirloc + '/base/../../'+ oid
        toDir = dirloc + '/base/'
        newfault.move_dir(hostname, fromDir, toDir)
        newfault.drop_db()
        
        #Create db so that validations will work
        newfault.create_db()