Skip to content

Commit

Permalink
Add tests for load_config()
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Aug 12, 2021
1 parent 83e74a9 commit 7e9fd0a
Show file tree
Hide file tree
Showing 5 changed files with 533 additions and 2 deletions.
76 changes: 76 additions & 0 deletions tests/configs/config-0.4.1-edit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# ReproZip configuration file
# This file was generated by reprozip 0.4.1 at 2021-08-12T15:20:22.020746

# You might want to edit this file before running the packer
# See 'reprozip pack -h' for help

# Run info
version: "0.4.1"
runs:
- architecture: x86_64
argv:
- sh
- -c
- wc -l /tmp/input.txt >/tmp/lines
binary: /bin/sh
distribution:
- Ubuntu
- '20.04'
environ:
HOME: /home/remram
LANG: en_US.UTF-8
exitcode: 0
gid: 1000
hostname: axon
input_files:
text: /tmp/input.txt
output_files:
lines: /tmp/lines
system:
- Linux
- 5.4.0-80-generic
uid: 1000
workingdir: /home/remram

# Files to pack
# All the files below were used by the program; they will be included in the
# generated package

# These files come from packages; we can thus choose not to include them, as it
# will simply be possible to install that package on the destination system
# They are included anyway by default
packages:
- name: "coreutils"
version: "8.30-3ubuntu2"
size: 7368704
packfiles: true
files:
# Total files used: 46.34 KB
# Installed package size: 7.03 MB
- "/usr/bin/wc" # 46.34 KB
- name: "libc6"
version: "2.31-0ubuntu9.3"
size: 13563904
packfiles: true
files:
# Total files used: 363.39 KB
# Installed package size: 12.94 MB
- "/lib/x86_64-linux-gnu/libc-2.31.so" # 1.94 MB
- "/lib/x86_64-linux-gnu/libc.so.6" # Link to /lib/x86_64-linux-gnu/libc-2.31.so

# These files do not appear to come with an installed package -- you probably
# want them packed
other_files:
- "/tmp" # Directory
- "/tmp/input.txt" # 3.64 KB
- "/usr/lib/locale/locale-archive" # 5.49 MB

# If you want to include additional files in the pack, you can list additional
# patterns of files that will be included
# Example:
additional_patterns:
- /etc/apache2/**
# - /etc/apache2/** # Everything under apache2/
# - /var/log/apache2/*.log # Log files directly under apache2/
# - /var/lib/lxc/*/rootfs/home/**/*.py # All Python files of all users in
# # that container
65 changes: 65 additions & 0 deletions tests/configs/config-0.4.1-packed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# ReproZip configuration file
# This file was generated by reprozip 0.4.1 at 2021-08-12T15:24:42.269552

# It was generated by the packer and you shouldn't need to edit it

# Run info
version: "0.4.1"
runs:
- architecture: x86_64
argv:
- sh
- -c
- wc -l /tmp/input.txt >/tmp/lines
binary: /bin/sh
distribution:
- Ubuntu
- '20.04'
environ:
HOME: /home/remram
LANG: en_US.UTF-8
exitcode: 0
gid: 1000
hostname: axon
input_files:
text: /tmp/input.txt
output_files:
lines: /tmp/lines
system:
- Linux
- 5.4.0-80-generic
uid: 1000
workingdir: /home/remram

# Files to pack
# All the files below were used by the program; they will be included in the
# generated package

# These files come from packages; we can thus choose not to include them, as it
# will simply be possible to install that package on the destination system
# They are included anyway by default
packages:
- name: "coreutils"
version: "8.30-3ubuntu2"
size: 7368704
packfiles: true
files:
# Total files used: 46.34 KB
# Installed package size: 7.03 MB
- "/usr/bin/wc" # 46.34 KB
- name: "libc6"
version: "2.31-0ubuntu9.3"
size: 13563904
packfiles: true
files:
# Total files used: 363.39 KB
# Installed package size: 12.94 MB
- "/lib/x86_64-linux-gnu/libc-2.31.so" # 1.94 MB
- "/lib/x86_64-linux-gnu/libc.so.6" # Link to /lib/x86_64-linux-gnu/libc-2.31.so

# These files do not appear to come with an installed package -- you probably
# want them packed
other_files:
- "/tmp"
- "/tmp/input.txt"
- "/usr/lib/locale/locale-archive"
95 changes: 95 additions & 0 deletions tests/configs/config-1.0-edit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# ReproZip configuration file
# This file was generated by reprozip 1.1 at 2021-08-12T14:40:36-04:00

# You might want to edit this file before running the packer
# See 'reprozip pack -h' for help

# Run info
version: "0.8"
runs:
# Run 0
- architecture: x86_64
argv:
- sh
- -c
- wc -l /tmp/input.txt >/tmp/lines
binary: /bin/sh
distribution:
- ubuntu
- '20.04'
environ:
HOME: /home/remram
LANG: en_US.UTF-8
exitcode: 0
gid: 1000
hostname: axon
id: run0
system:
- Linux
- 5.4.0-80-generic
uid: 1000
workingdir: /home/remram

# Input and output files

# Inputs are files that are only read by a run; reprounzip can replace these
# files on demand to run the experiment with custom data.
# Outputs are files that are generated by a run; reprounzip can extract these
# files from the experiment on demand, for the user to examine.
# The name field is the identifier the user will use to access these files.
inputs_outputs:
- name: text
path: /tmp/input.txt
written_by_runs: []
read_by_runs: [0]
- name: lines
path: /tmp/lines
written_by_runs: [0]
read_by_runs: []
- name: other
path: /tmp/other
written_by_runs: [0]
read_by_runs: [0]

# Files to pack
# All the files below were used by the program; they will be included in the
# generated package

# These files come from packages; we can thus choose not to include them, as it
# will simply be possible to install that package on the destination system
# They are included anyway by default
packages:
- name: "coreutils"
version: "8.30-3ubuntu2"
size: 7368704
packfiles: true
files:
# Total files used: 46.34 KB
# Installed package size: 7.03 MB
- "/usr/bin/wc" # 46.34 KB
- name: "libc6"
version: "2.31-0ubuntu9.3"
size: 13563904
packfiles: true
files:
# Total files used: 2.29 MB
# Installed package size: 12.94 MB
- "/lib/x86_64-linux-gnu/libc-2.31.so" # 1.94 MB
- "/lib/x86_64-linux-gnu/libc.so.6" # Link to /lib/x86_64-linux-gnu/libc-2.31.so

# These files do not appear to come with an installed package -- you probably
# want them packed
other_files:
- "/tmp" # Directory
- "/tmp/input.txt" # 3.64 KB
- "/usr/lib/locale/locale-archive" # 5.49 MB

# If you want to include additional files in the pack, you can list additional
# patterns of files that will be included
additional_patterns:
- /etc/apache2/**
# Example:
# - /etc/apache2/** # Everything under apache2/
# - /var/log/apache2/*.log # Log files directly under apache2/
# - /var/lib/lxc/*/rootfs/home/**/*.py # All Python files of all users in
# # that container
85 changes: 85 additions & 0 deletions tests/configs/config-1.0-packed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# ReproZip configuration file
# This file was generated by reprozip 1.1 at 2021-08-12T14:42:05-04:00

# It was generated by the packer and you shouldn't need to edit it

# Run info
pack_id: "1f1444d7-41e5-4cbd-a526-b0cbf83a6bf8"
version: "0.8"
runs:
# Run 0
- architecture: x86_64
argv:
- sh
- -c
- wc -l /tmp/input.txt >/tmp/lines
binary: /bin/sh
distribution:
- ubuntu
- '20.04'
environ:
HOME: /home/remram
LANG: en_US.UTF-8
exitcode: 0
gid: 1000
hostname: axon
id: run0
system:
- Linux
- 5.4.0-80-generic
uid: 1000
workingdir: /home/remram

# Input and output files

# Inputs are files that are only read by a run; reprounzip can replace these
# files on demand to run the experiment with custom data.
# Outputs are files that are generated by a run; reprounzip can extract these
# files from the experiment on demand, for the user to examine.
# The name field is the identifier the user will use to access these files.
inputs_outputs:
- name: text
path: /tmp/input.txt
written_by_runs: []
read_by_runs: [0]
- name: lines
path: /tmp/lines
written_by_runs: [0]
read_by_runs: []
- name: other
path: /tmp/other
written_by_runs: [0]
read_by_runs: [0]

# Files to pack
# All the files below were used by the program; they will be included in the
# generated package

# These files come from packages; we can thus choose not to include them, as it
# will simply be possible to install that package on the destination system
# They are included anyway by default
packages:
- name: "coreutils"
version: "8.30-3ubuntu2"
size: 7368704
packfiles: true
files:
# Total files used: 0.0 bytes
# Installed package size: 7.03 MB
- "/usr/bin/wc"
- name: "libc6"
version: "2.31-0ubuntu9.3"
size: 13563904
packfiles: true
files:
# Total files used: 0.0 bytes
# Installed package size: 12.94 MB
- "/lib/x86_64-linux-gnu/libc-2.31.so"
- "/lib/x86_64-linux-gnu/libc.so.6"

# These files do not appear to come with an installed package -- you probably
# want them packed
other_files:
- "/tmp"
- "/tmp/input.txt"
- "/usr/lib/locale/locale-archive"

0 comments on commit 7e9fd0a

Please sign in to comment.