An apparatus is disclosed for perforating, testing, and repairing casing in an earth borehole. A device is moveable through the casing. The device can be mounted on a wireline, on tubing, or on both. A perforator is mounted in the device for producing a perforation in the casing. The device will also generally include components for hydraulic testing/sampling from the formations behind the casing. A plugger is mounted in the device for plugging the perforation with a solid plug or a non-solid sealant.