LCOV - code coverage report
Current view: top level - nspawn - test-patch-uid.c (source / functions) Hit Total Coverage
Test: systemd_full.info Lines: 0 19 0.0 %
Date: 2019-08-23 13:36:53 Functions: 0 1 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 18 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: LGPL-2.1+ */
       2                 :            : 
       3                 :            : #include <stdlib.h>
       4                 :            : 
       5                 :            : #include "log.h"
       6                 :            : #include "nspawn-patch-uid.h"
       7                 :            : #include "user-util.h"
       8                 :            : #include "tests.h"
       9                 :            : #include "util.h"
      10                 :            : 
      11                 :          0 : int main(int argc, char *argv[]) {
      12                 :            :         uid_t shift, range;
      13                 :            :         int r;
      14                 :            : 
      15                 :          0 :         test_setup_logging(LOG_DEBUG);
      16                 :            : 
      17         [ #  # ]:          0 :         if (argc != 4) {
      18         [ #  # ]:          0 :                 log_error("Expected PATH SHIFT RANGE parameters.");
      19                 :          0 :                 return EXIT_FAILURE;
      20                 :            :         }
      21                 :            : 
      22                 :          0 :         r = parse_uid(argv[2], &shift);
      23         [ #  # ]:          0 :         if (r < 0) {
      24         [ #  # ]:          0 :                 log_error_errno(r, "Failed to parse UID shift %s.", argv[2]);
      25                 :          0 :                 return EXIT_FAILURE;
      26                 :            :         }
      27                 :            : 
      28                 :          0 :         r = parse_gid(argv[3], &range);
      29         [ #  # ]:          0 :         if (r < 0) {
      30         [ #  # ]:          0 :                 log_error_errno(r, "Failed to parse UID range %s.", argv[3]);
      31                 :          0 :                 return EXIT_FAILURE;
      32                 :            :         }
      33                 :            : 
      34                 :          0 :         r = path_patch_uid(argv[1], shift, range);
      35         [ #  # ]:          0 :         if (r < 0) {
      36         [ #  # ]:          0 :                 log_error_errno(r, "Failed to patch directory tree: %m");
      37                 :          0 :                 return EXIT_FAILURE;
      38                 :            :         }
      39                 :            : 
      40         [ #  # ]:          0 :         log_info("Changed: %s", yes_no(r));
      41                 :            : 
      42                 :          0 :         return EXIT_SUCCESS;
      43                 :            : }

Generated by: LCOV version 1.14