Defined Type: httpbb::test_suite

Defined in:
modules/httpbb/manifests/test_suite.pp

Overview

SPDX-License-Identifier: Apache-2.0

Defined type httpbb::test_suite

Resource for httpbb test suite YAML files, which are installed into the directory passed as $tests_dir to the httpbb class. That class must be declared before any httpbb::test_suite resources.

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: 'present')
  • mode (Optional[String]) (defaults to: undef)
  • source (Optional[Stdlib::Filesource]) (defaults to: undef)
  • content (Optional[String]) (defaults to: undef)


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'modules/httpbb/manifests/test_suite.pp', line 7

define httpbb::test_suite(
    Wmflib::Ensure $ensure = 'present',
    Optional[String] $mode = undef,
    Optional[Stdlib::Filesource] $source = undef,
    Optional[String] $content = undef,
){
    if !defined(Class['httpbb']) {
        fail('Declare the httpbb class before using httpbb::test_suite.')
    }

    $path = "${::httpbb::tests_dir}/${title}"

    if $ensure == 'absent' {
        file { $path:
            ensure => absent,
        }
    } elsif $source {
        file { $path:
            ensure => file,
            mode   => $mode,
            source => $source,
        }
    } elsif $content {
        file { $path:
            ensure  => file,
            mode    => $mode,
            content => $content,
        }
    } else {
        fail('Define either source or content, or ensure => absent.')
    }

}