Esempio n. 1
0
    def test_seed_read_user_data_callback_valid_disk(self):
        populate_user_metadata(self.seed_dir, '')
        populate_cloud_metadata(self.seed_dir, CLOUD_METADATA)
        results = ds.read_user_data_callback(self.seed_dir)

        self.assertNotEqual(results, None)
        self.assertTrue('userdata' in results)
        self.assertTrue('metadata' in results)
        self.assertTrue('cfg' in results)
Esempio n. 2
0
    def test_seed_read_user_data_callback_userdata(self):
        userdata = "#!/bin/sh\nexit 1"
        populate_user_metadata(self.seed_dir, userdata)
        populate_cloud_metadata(self.seed_dir, CLOUD_METADATA)

        results = ds.read_user_data_callback(self.seed_dir)

        self.assertNotEqual(results, None)
        self.assertTrue('userdata' in results)
        self.assertEqual(results['userdata'], userdata)
Esempio n. 3
0
    def test_seed_read_user_data_callback_empty_file(self):
        populate_user_metadata(self.seed_dir, '')
        populate_cloud_metadata(self.seed_dir, {})
        results = ds.read_user_data_callback(self.seed_dir)

        self.assertIsNone(results)