Module: Platform::SpecMethods

Defined in:
lib/cem_acpt/platform/gcp.rb

Overview

Holds class methods called from spec tests.

Instance Method Summary collapse

Instance Method Details

#apply_manifest(instance_name, manifest, opts = {}) ⇒ String

Apllies the given Puppet manifest on the given instance

Parameters:

  • instance_name (String)

    the name of the instance to apply the manifest to

  • manifest (String)

    the Puppet manifest to apply

  • opts (Hash) (defaults to: {})

    options to pass to the apply command

Returns:

  • (String)

    the output of the apply command



72
73
74
# File 'lib/cem_acpt/platform/gcp.rb', line 72

def apply_manifest(instance_name, manifest, opts = {})
  command_provider.apply_manifest(instance_name, manifest, opts)
end

#command_providerCemAcpt::Platform::Gcp::Cmd

Returns an instance of the GCP platform class command provider

Returns:

  • (CemAcpt::Platform::Gcp::Cmd)


63
64
65
# File 'lib/cem_acpt/platform/gcp.rb', line 63

def command_provider
  CemAcpt::Platform::Gcp::Cmd.new(out_format: 'json')
end

#run_shell(instance_name, cmd, opts = {}) ⇒ String

Runs a shell command on the given instance

Parameters:

  • instance_name (String)

    the name of the instance to run the command on

  • command (String)

    the command to run

  • opts (Hash) (defaults to: {})

    options to pass to the run_shell command

Returns:

  • (String)

    the output of the run_shell command



81
82
83
# File 'lib/cem_acpt/platform/gcp.rb', line 81

def run_shell(instance_name, cmd, opts = {})
  command_provider.run_shell(instance_name, cmd, opts)
end