Giter Site home page Giter Site logo

teuton-software / teuton Goto Github PK

View Code? Open in Web Editor NEW
29.0 29.0 5.0 2.95 MB

Infrastructure test, mainly useful for sysadmin teachers and making contests

License: GNU General Public License v3.0

Ruby 84.06% Shell 4.56% PowerShell 1.95% Dockerfile 0.13% HTML 9.28% Batchfile 0.02%
box host infrastructure machine mo monitoring remote sysadmin system test testing-infrastructure training unit unit-testing white

teuton's People

Contributors

davafons avatar dvarrui avatar fvarrui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

teuton's Issues

Group and goal

Replace task by group and
Replace target by goal

Deprecate old comando.

GPG Sign reports

Sign reports generated with GPG... just to verify autenticity if needed.

Groups

Modifiy internal array data to contains group information. Then pass this values to report class to be used into output files.

result.ok or expect_ok

Check exit code from remote command execution.
When exit_code is 0 then result.ok is true and expect_ok verify that result.ok == true

send: change default remote dir

Choose same remote dir (on every platform) to send files.

  • GNU/Linux and MACOS .... /var/teuton
  • Windows c:\teuton
    We have to create this directory before.

Revise documentation

English and Spanish documentation must be put up to day.
Include information about new run DSL instruction.

New DSL instrucction (run)

Add instruction "run" into DSL. Example:
run "whoami"
This will be the same as
goto :localhost, :exec => "whoami"

Get/detalles for hostal data

New Get and set methods..
To use with host data. Example

Get_host (:debian1 ) => hash with ip username passwd hostname and protocol

Set _host (suse1, debian1) => will copy debian1 host data into suse1

Create test_case

Create something like test/test_case.rb judt to test if Case class is working as we want.

Remote script

When we do something like:
goto :host1, :exec => "script.sh"
We are connecting to remote host (host1) and then trying to execute script "script.sh" located into this remote host.... but cuold we pass this file from local to remote host before executing this...

Perhaps doing (before) a file scp to remote host and then normal execution?
Well, it may be! But I'm not agree with update or change remote hosts doing this....
We'll think of it.

Bad exit code when teuton upgrade fails

When I run teuton upgrade and it fails, exit code 0 is returned, which is wrong because it has to return other than 0:

$ teuton upgrade
error: no se puede abrir .git/FETCH_HEAD: Permiso denegado
$ echo $?
0

Upgrade command doesn't work on Windows

When I execute the next command in CMD:

teuton upgrade

I've got an error:

System can not find the path specified

Looking source code I found this piece of code in lib/command/update.rb, which causes the problem:

  def upgrade
    system("cd /opt/teuton && git pull")
  end

In Windows, Teuton's path is C:\Program files\teuton.

Misleading error messages

When running a non-existent verb (like teuton blabla foo for instance) or a non-existent challenge (like teuton run as6j843df), the error message is always the same: "[ERROR[ .rb extension required!" , which is a lot misleading. Please make Teuton distingish most error types to be able to show more according messages. Thanks!

Report class

Split Report class into: CaseReport and ResumeReport

New methods get_XXX

For every hashtag into YAML config file... metaprograming could build his methods... I mean

get(:username) vs get_username
get(:host1_ip) vs get_host1_ip

I think it could be nice ;-)
Very rubistic way.

challenges info

teuton info path/to/project/dir: will show brief resumed info about this challenge.

moodle.csv and resume.txt/.json files are being overwritten

Each execution of teuton overwrites the moodle.csv and resume.txt/.json files, so if successive executions are carried out (skipping test cases) previous results are lost.

A possible solution would be to include the date and time of creation of those file as part of their names in (format yyyyMMddHHmmss), for example:

moodle-20201001162700.csv
resume-20201001162700.txt
resume-20201001162700.json

If they were generated on 1st october 2020 at 16:27:00.

Linux and Mac installation scripts' URL are broken in Wiki article

Specifically, in https://github.com/teuton-software/teuton/wiki/Installation-using-scripts it's said to run this command in order to install Teuton in a Linux system acting as a T-Node:

wget -qO- https://raw.githubusercontent.com/teuton-software/teuton/master/bin/linux_t-node_install.sh | bash

Which gives a 404 error.

The good link for Linux is this instead: https://raw.githubusercontent.com/teuton-software/teuton/master/install/linux/linux_t-node_install.sh

For Mac installation it's the same issue

Thanks

Export as json fails

When I run the next command:

teuton play <challenge-folder> --export=json

I've got the next error:

C:/Program Files/teuton/lib/formatter/yaml_formatter.rb:58:in `build_history_data': undefined local variable or method `bady' for #<JSONFormatter:0x0000000005f17a20> (NameError)
Did you mean?  body
	from C:/Program Files/teuton/lib/formatter/yaml_formatter.rb:20:in `build_data'
	from C:/Program Files/teuton/lib/formatter/json_formatter.rb:13:in `process'
	from C:/Program Files/teuton/lib/report.rb:34:in `export'
	from C:/Program Files/teuton/lib/case_manager/export.rb:13:in `export'
	from C:/Program Files/teuton/lib/case_manager.rb:44:in `play'
	from C:/Program Files/teuton/lib/case_manager/dsl.rb:11:in `play'
	from D:/Users/fvarrui/Documents/GitHub/teuton-challenges/os-basic-level/users_and_groups/start.rb:40:in `<top (required)>'
	from C:/Program Files/teuton/lib/project.rb:38:in `require_relative'
	from C:/Program Files/teuton/lib/project.rb:38:in `play'
	from C:/Program Files/teuton/lib/command/play.rb:25:in `play'
	from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	from C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
	from C:/Program Files/teuton//teuton:32:in `<main>'

search challenges

Create something like:

  • teuton search apache2: find challenges related with apache2 searching by several local or remote repos.
  • teuton build-search-index: to acomplish previous function we will need to create an index with all info challenges for every repo (local or remote).

Show help for SSH errors

Notice and detect every different SSH error:

  • Bad password, known_host, closed port, ping dont respond,,,
    And give user information about how to solve every different problem.

DSL help instruction

help instruction will show some usefull information to user when we detect that the user can't resolv the target by himself.
We need to count every attemp and when this number is higher than X we will show user this information. Example:

target "Create user david"
run "whoami"
help "Use useradd command", :attempts => 3
expect.result.equal("david")

If the user needs help to resolv the target... the score must be penalized...doesn't it?

Error installing pry-byebug:

When I run sudo rake gems I get error in this gem.

Building native extensions. This could take a while...
ERROR: Error installing pry-byebug:
ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.5.0/gems/byebug-10.0.2/ext/byebug
/usr/bin/ruby2.5 -r ./siteconf20180926-22620-7ommdj.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

export: hide/show command/alterations into output report

When export report with all data about every student/case.... it could be usefull hide some data. For example:
04 (1.0/1.0)
Description : User logged
Command : last | grep oscar
Duration : 0.043 (ssh)
Alterations : count!
Expected : Not equal to 0 (String)
Result : 22 (Integer)

This output data show student all information about his target... but we could want to hide for example: command, alterations. Only the teacher will know what command has been used to verify their system.

DSL to read INI files

Create DSL instructions that reads INI files. For example:

target "Checking SMB configuration"
goto :debian, :exec => "cat /etc/samba/smb.conf"
expect result.section("public").param("path").equal("/var/samba/public.d")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.