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"
    

Last updated