Пример #1
0
def test_pxe_image_type_required_error_validation():
    """Test to validate pxe image type in customization templates."""
    template_name = pxe.CustomizationTemplate(
        name=fauxfactory.gen_alphanumeric(8),
        description=fauxfactory.gen_alphanumeric(16),
        image_type='<Choose>',
        script_type='Kickstart',
        script_data='Testing the script')

    with error.expected("Pxe_image_type can't be blank"):
        template_name.create()
Пример #2
0
def test_pxe_image_type_required_error_validation():
    """Test to validate pxe image type in customization templates."""
    template_name = pxe.CustomizationTemplate(
        name=generate_random_string(size=8),
        description=generate_random_string(size=16),
        image_type='<Choose>',
        script_type='Kickstart',
        script_data='Testing the script')

    with error.expected("Pxe_image_type can't be blank"):
        template_name.create()
Пример #3
0
def test_type_required_error_validation():
    """Test to validate type in customization templates."""
    template_name = pxe.CustomizationTemplate(
        name=fauxfactory.gen_alphanumeric(8),
        description=fauxfactory.gen_alphanumeric(16),
        image_type='RHEL-6',
        script_type='<Choose>',
        script_data='Testing the script')

    with error.expected('Type is required'):
        template_name.create()
Пример #4
0
def test_type_required_error_validation():
    """Test to validate type in customization templates."""
    template_name = pxe.CustomizationTemplate(
        name=generate_random_string(size=8),
        description=generate_random_string(size=16),
        image_type='RHEL-6',
        script_type='<Choose>',
        script_data='Testing the script')

    with error.expected('Type is required'):
        template_name.create()
Пример #5
0
def test_name_max_character_validation():
    """Test to validate name with maximum characters in customization templates."""
    template_name = pxe.CustomizationTemplate(
        name=fauxfactory.gen_alphanumeric(256),
        description=fauxfactory.gen_alphanumeric(16),
        image_type='RHEL-6',
        script_type='Kickstart',
        script_data='Testing the script')

    with error.expected('Name is required'):
        template_name.create()
    template_name.delete(cancel=False)
Пример #6
0
def test_name_max_character_validation():
    """Test to validate name with maximum characters in customization templates."""
    template_name = pxe.CustomizationTemplate(
        name=generate_random_string(size=256),
        description=generate_random_string(size=16),
        image_type='RHEL-6',
        script_type='Kickstart',
        script_data='Testing the script')

    with error.expected('Name is required'):
        template_name.create()
    template_name.delete(cancel=False)
Пример #7
0
def test_duplicate_name_error_validation():
    """Test to validate duplication in customization templates."""
    template_name = pxe.CustomizationTemplate(
        name=fauxfactory.gen_alphanumeric(8),
        description=fauxfactory.gen_alphanumeric(16),
        image_type='RHEL-6',
        script_type='Kickstart',
        script_data='Testing the script')

    template_name.create()
    with error.expected('Name has already been taken'):
        template_name.create()
    template_name.delete(cancel=False)
Пример #8
0
def test_customization_template_crud():
    """Basic CRUD test for customization templates."""
    template_crud = pxe.CustomizationTemplate(
        name=fauxfactory.gen_alphanumeric(8),
        description=fauxfactory.gen_alphanumeric(16),
        image_type='RHEL-6',
        script_type='Kickstart',
        script_data='Testing the script')

    template_crud.create()
    with update(template_crud):
        template_crud.name = template_crud.name + "_update"
    template_crud.delete(cancel=False)
Пример #9
0
def test_duplicate_name_error_validation():
    """Test to validate duplication in customization templates."""
    template_name = pxe.CustomizationTemplate(
        name=generate_random_string(size=8),
        description=generate_random_string(size=16),
        image_type='RHEL-6',
        script_type='Kickstart',
        script_data='Testing the script')

    template_name.create()
    with error.expected('Name has already been taken'):
        template_name.create()
    template_name.delete(cancel=False)
Пример #10
0
def test_customization_template_crud():
    """Basic CRUD test for customization templates."""
    template_crud = pxe.CustomizationTemplate(
        name=generate_random_string(size=8),
        description=generate_random_string(size=16),
        image_type='RHEL-6',
        script_type='Kickstart',
        script_data='Testing the script')

    template_crud.create()
    with update(template_crud):
        template_crud.name = template_crud.name + "_update"
    template_crud.delete(cancel=False)