SVRUnit
  • Welcome
  • Installation
    • Installation
    • First Run
  • Use Cases
    • Verify Server
    • Verify Server for Project
    • Post Deployment Tests
    • Unit Test Docker Image
    • Testing your frameworks
  • Configuration
    • Configuration
  • Commands
    • list:suites
    • list:groups
    • test
  • Assertions
    • Command
    • Directory Exists
    • File Exists
    • File Content
    • File Permissions
    • PHP INI
    • PHP Modules
  • Reports
    • HTML Report
    • JUnit Report
  • Resources
    • svrunit.com
    • Github
Powered by GitBook
On this page

Was this helpful?

  1. Use Cases

Verify Server

You can use SVRUnit to verify that a certain server has everything you need.

A classical usage is, that you order a server from your hoster with different requirements. You can build a YML file with all tests of your requirements and simply run the tests, once your server is ready.

A good recommendation is to use the plain PHAR file for this.

Here is a sample how it could look like

XML Configuration

<svrunit>  
  <testsuites>   
      
      <testsuite name="My Server Tests">         
         <file>./shopware6.yml</file>      
      </testsuite>   
        
  </testsuites>
</svrunit>

Test File

commands:

  - name: "VIM is installed"
    command: "vim --v"
    expected: "VIM - Vi IMproved"
    
  - name: "Permission: Verify 'www-data' has no shell login"
    command: "cat /etc/passwd"
    expected: "www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin"
    
php_ini:  

  - name: "PHP Version is 8.1 for Web"  
    setting: "PHP_VERSION"  
    mode: "web"   
    value_or:    
      - operator: "="   
        value: "8.1"  
  
  - name: "PHP Version is 8.1 for CLI"  
    setting: "PHP_VERSION"  
    mode: "cli"   
    value_or:    
      - operator: "="   
        value: "8.1"  
        
  - name: "memory_limit 512M" 
    setting: "memory_limit"   
    mode: "web"   
    value_or:  
      - operator: "="   
        value: "512M"
  
php_module:

  - name: "ext-curl is installed"   
    module: "curl"
    

PreviousFirst RunNextVerify Server for Project

Last updated 2 years ago

Was this helpful?