def test_filter_nodes_roles(self):
        data = chef.filter_nodes(chef.get_nodes_extended(),
                                 roles=['dbserver'])
        self.assertEqual(len(data), 2)
        self.assertEqual(data[0]['name'], "testnode3.mydomain.com")

        data = chef.filter_nodes(chef.get_nodes_extended(),
                                 roles=['loadbalancer'])
        self.assertEqual(len(data), 1)
        self.assertEqual(data[0]['name'], "testnode1")

        data = chef.filter_nodes(chef.get_nodes_extended(),
                                 roles=['webserver'])
        self.assertEqual(len(data), 4)
        self.assertEqual(data[0]['name'], "testnode2")

        data = chef.filter_nodes(chef.get_nodes_extended(),
                                 roles=['webserver', 'dbserver'])
        self.assertEqual(len(data), 6)
        self.assertEqual(data[1]['name'], "testnode3.mydomain.com")
Should filter nodes acording to their virt value
dataset/ETHPy150Open edelight/kitchen/kitchen/backends/tests.py/TestData.test_filter_nodes_roles