Skip to content

agonzalezro/servpeek

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

servpeek

Introspective peek into your server guts

Motivation

Currently the most widely used tools for testing your infrastructure are serverspec and infrataster.

Hoever these being written in ruby they carry a decent amount of runtime an gem dependencies. Writing a simple tool in Go programming language would help to address these and would further simplify the ditribution and speed of deployment.

Current state

Current design might be a bit of a overkill mostly because of my Golang incompetence or because the projects tries to create abstractions on top of already existing abstractions (package managers, commands etc.). Turns out modelling this is not very easy :-/

Project currently provides support for various package managers: apt, yum, apk, gem and pip as well as file inspections. More resources will be added later as the project moves on [if].

Usage

Currently there is no single program to run as it stands. Instead you can simply invoke the familiar go test on any of the examples in examples subdirectory. You can obviously create your own _test.go files for the stuff you want to test.

Example

Get the package:

$ go get github.com/milosgajdos83/servpeek

Example test file could look like this:

package examples

import (
	"testing"

	"github.com/milosgajdos83/servpeek/resource"
	"github.com/milosgajdos83/servpeek/resource/pkg"
)

func TestGemPackage(t *testing.T) {
	testPkg := resource.Pkg{
		Name:    "bundler",
		Version: "1.10.6",
		Type:    "gem",
	}

	if err := pkg.IsInstalledVersion(testPkg); err !=nil {
		t.Errorf("Error: %s", err)
	}
}

Running the tests:

$ go test gem_package_test.go
ok  	command-line-arguments	0.330s

TOD:

  • A LOT more resources
  • Better logging and error statements
  • redesign if possible :-)

About

Introspective peek into your server guts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%