Autonomous vehicles (AVs) and cooperative automated vehicles (CAVs) are expected to largely reshape our mobility systems. The limited deployment of AVs and CAVs on roads makes it difficult to fully assess their impact and interactions with other road users. Advanced simulations are often sought for conducting accelerated tests of AVs and CAVs in a virtual environment. However, existing off-the-shelf simulators are typically focused on conventional traffic simulation and human-driving simulation. Advanced simulators that enable core functionalities (e.g., sensing and communication) of AVs and CAVs have been underexploited. In this paper, the authors aim to develop a realistic co-simulation framework for testing autonomous driving and cooperative driving automation (CDA). The proposed co-simulation framework utilizes the open-source concept to support the AV and CAV community in developing and deploying AV and CAV technologies. This framework integrates multiple open-source platforms, including Eclipse MOSAIC™ simulation framework, Eclipse Simulation of Urban Mobility (SUMO™) traffic simulator, and CARLA AV driving simulator. The framework enables AV and CAV simulation in mixed traffic environments. The developed co-simulation models have been tested with different scales of networks and traffic flow. The assessment of the co-simulation framework shows that it can support faster-than-real-time simulation for use in accelerated tests with more realistic scenarios. In addition, the developed co-simulation framework is proven to be extensible with the inclusion of other network simulators for supporting vehicle-to-everything (V2X) communication among vehicles.