Upgrade to Pro — share decks privately, control downloads, hide ads and more …

OTRS Pakete ausgiebig testen und "verifizieren"

Renee
March 26, 2014

OTRS Pakete ausgiebig testen und "verifizieren"

Renee

March 26, 2014
Tweet

More Decks by Renee

Other Decks in Programming

Transcript

  1. [email protected]
    Perl-Entwicklung, OTRS, Training

    View full-size slide

  2. Achtung: WIP

    View full-size slide

  3. OTRS-Pakete
    testen und
    verifizieren

    View full-size slide

  4. HelpDesk-System

    View full-size slide


  5. Gestartet 2001

    1,7 Mio. Downloads

    ca. 110.000 Installationen

    33 Sprachen

    AGPL

    http://github.com/OTRS/otrs

    View full-size slide

  6. http://upload.wikimedia.org/wikipedia/commons/thumb/9/92/Penguin_Admin.svg/105px-Penguin_Admin.svg.png

    View full-size slide

  7. Ich brauche eine FAQ
    http://upload.wikimedia.org/wikipedia/commons/thumb/9/92/Penguin_Admin.svg/105px-Penguin_Admin.svg.png

    View full-size slide

  8. Ich brauche eine FAQ
    Mehr Attribute für Cis
    http://upload.wikimedia.org/wikipedia/commons/thumb/9/92/Penguin_Admin.svg/105px-Penguin_Admin.svg.png

    View full-size slide

  9. Ich brauche eine FAQ
    Mehr Attribute für Cis
    Tickets besser erkennen
    http://upload.wikimedia.org/wikipedia/commons/thumb/9/92/Penguin_Admin.svg/105px-Penguin_Admin.svg.png

    View full-size slide

  10. Erweiterungen
    Für OTRS

    View full-size slide


  11. FAQ

    ITSM – ConfigurationManagement

    ITSM – ChangeManagement

    ITSM – IncidentProblemManagement

    KIX4OTRS

    TaggedCustomerUser



    View full-size slide

  12. Paketmanager

    View full-size slide

  13. Screenshot Paketmanager

    View full-size slide

  14. Screenshots OPAR
    http://opar.perl-services.de/

    View full-size slide

  15. Probleme OPAR

    View full-size slide

  16. Vorteil CPAN

    View full-size slide

  17. OTRS-Pakete
    testen und
    verifizieren

    View full-size slide


  18. Einhalten von OTRS-Programmierrichtlinien
    (Perl::Critic und Perl::Tidy)

    Unittests sollen fehlerfrei durchlaufen

    Stabilität und Performanz von OTRS nicht
    beeinträchtigen

    Keine ungewünschte Kommunikation nach
    außen

    Trennung von Templates/Funktionalität

    u.v.m.

    View full-size slide


  19. Automatisiertes Testen von
    OTRS-Erweiterungen
    – Statische Analyse
    – Laufzeittest

    Ziele
    – Sicherheitslücken (nahezu) ausschließen
    – Getestete Module
    – Usern mehr Informationen zum Modul liefern
    – Performancefresser identifizieren

    View full-size slide

  20. Schritt 1:
    Upload

    View full-size slide

  21. # init fork manager
    my $max_processes = $self->config->get( 'fork.max' );
    my $fork_manager = Parallel::ForkManager->new(
    $max_processes
    );
    $logger->trace(
    'init fork manager with max ' .$max_processes . ' processes'
    );
    for my $tmpjob ( @job_info ) {
    # do the fork
    $fork_manager->start and next;
    # create job and run it
    my $job = OTRS::OPR::Daemon::Job->new( %{$tmpjob} );
    $job->run if $job;
    }
    # exit the forked process
    $fork_manager->finish;
    $fork_manager->wait_all_children;

    View full-size slide

  22. Schritt 2:
    Erste Analyse

    View full-size slide



  23. WarnMissingAttachment
    3.3.1
    3.2.x
    3.3.x
    Perl-Services.de
    http://www.perl-services.de
    xxxxxxxxxx
    Perl::Module
    ITSM

    GNU AFFERO GENERAL PUBLIC LICENSE Version 3, November 2007


    Location="Kernel/Config/WarnMissingAttachment.xml">
    PD94bWwgdmVyc2






    View full-size slide

  24. OTRS::OPM::Analyzer

    View full-size slide

  25. use OTRS::OPM::Analyzer::Utils::OPMFile;
    my $opm_file = '/path/to/package.opm';
    my $opm = OTRS::OPM::Analyzer::Utils::OPMFile->new(
    opm_file => $opm_file,
    );
    my @otrs_versions = $opm->framework;

    View full-size slide

  26. Schritt 3:
    VM erstellen

    View full-size slide

  27. use Rex;
    use Rex::Commands::Cloud;
    cloud_service 'Jiffybox';
    cloud_auth $api_key;
    for my $otrs ( @otrs_versions ) {
    my $box = cloud_instance create => {
    image_id => "ubuntu_12_4",
    Name => "test-$otrs",
    plan_id => $plan_id,
    password => $root_pwd
    };
    cloud_instance start => $box->{id};
    }

    View full-size slide

  28. Screenshot Jiffybox adminpanel

    View full-size slide

  29. Schritt 4:
    Software
    installieren

    View full-size slide

  30. OTRS + MySQL

    View full-size slide

  31. cpanm, Apache 2, mod_perl,
    Perl-Module, libxml2-dev,
    libgd-xpm-dev, libssl-dev, …
    Software diese Projekts

    View full-size slide

  32. OTRS einrichten

    View full-size slide

  33. Rex
    Recipe „OTRS“

    View full-size slide

  34. install [qw/ libcrypt-ssleay-perl
    libgd-gd2-perl
    libencode-hanextra-perl
    ...
    libtext-csv-xs-perl
    libxml-parser-perl
    libyaml-perl
    libdbd-mysql-perl
    libnet-ldap-perl
    apache2
    /];

    View full-size slide

  35. create_user "otrs",
    home => "/opt/otrs",
    groups => ["www-data"],
    comment => "OTRS User",
    no_create_home => TRUE;
    Rex::Database::MySQL::Admin::Schema::create({
    name => $param->{schema}->{name},
    });
    Rex::Database::MySQL::Admin::User::create({
    name => $param->{user}->{name},
    host => $param->{user}->{host},
    password => $param->{user}->{password},
    rights => $param->{user}->{rights},
    schema => $param->{schema}->{name} . ".*",
    });

    View full-size slide

  36. Schritt 5:
    Metainformationen
    sammeln

    View full-size slide

  37. OTRS::OPM::Analyzer

    View full-size slide


  38. BasicXMLCheck

    Dependencies

    Documentation

    License

    PerlCritic

    PerlTidy

    SystemCall

    TemplateCheck

    UnitTests

    View full-size slide

  39. Perl::Critic::OTRS

    View full-size slide



  40. *::ProhibitFetchrowHashref

    *::ProhibitDumper

    *::ProhibitLocaltime

    *::ProhibitLowPrecedenceOps

    *::ProhibitOpen

    *::ProhibitPushISA

    *::ProhibitRequire

    *::ProhibitSomeCoreFunctions

    *::RequireCamelCase

    *::RequireParensWithMethods

    *::RequireTrueReturnValueForModules

    View full-size slide

  41. Schritt 6:
    Unittests I

    View full-size slide




  42. 5.14.2
    OTRS 3.3.1
    1
    16
    2013-12-30 01:35:01
    3
    ...


    JSON - undef test (is 'undef')
    JSON - empty test (is '""')
    JSON - simple (is '"Some Text"')


    ERROR: Syntax error in
    /opt/otrs/scripts/test/Layout.t: Can't use an undefined value
    as a HASH reference at /opt/otrs/Kernel/System/CustomerUser.pm
    line 87.



    View full-size slide

  43. OTRS::Unittest::XMLParser

    View full-size slide

  44. Capture::Tiny

    View full-size slide

  45. use Capture::Tiny qw(:all);
    use OTRS::Unittest::XMLParser;
    my ($out, $err) = capture {
    system '/opt/otrs/bin/otrs UnitTest.pl -o XML';
    };
    my $results = OTRS::Unittest::XMLParser->new(
    xml => $out,
    );
    for my $test ( @{ $result->tests } ) {
    say sprintf "%s -> %s", $test->name, $test->duration;
    }

    View full-size slide

  46. Schritt 7:
    Pakete
    installieren

    View full-size slide

  47. bin/otrs.PackageManager.pl -a install \
    -p /path/to/SalesforceForOTRS-3.3.1.opm

    View full-size slide



  48. WarnMissingAttachment
    3.3.1
    3.2.x
    3.3.x
    Perl-Services.de
    http://www.perl-services.de
    xxxxxxxxxx
    Perl::Module
    ITSM

    GNU AFFERO GENERAL PUBLIC LICENSE Version 3, November 2007


    Location="Kernel/Config/WarnMissingAttachment.xml">
    PD94bWwgdmVyc2






    View full-size slide

  49. OTRS::OPM::Analyzer

    View full-size slide

  50. Schritt 8:
    Unittests II … ∞

    View full-size slide

  51. Schritt 9:
    Pakete
    deinstallieren

    View full-size slide

  52. bin/otrs.PackageManager.pl -a uninstall \
    -p /path/to/SalesforceForOTRS-3.3.1.opm

    View full-size slide

  53. Schritt 10:
    Infos an OPAR

    View full-size slide

  54. Schritt 11:
    VM löschen

    View full-size slide

  55. VM::JiffyBox

    View full-size slide

  56. Offene Punkte

    View full-size slide


  57. Viel Code ;-)

    … Code-Snippets zusammenführen

    … In OPAR einbauen

    … „Kommunikation nach außen erkennen“


    Sonstiges

    … Finanzielle Unterstützung finden

    … Mehr Freizeit finden

    View full-size slide