blob: ddbb9eca9b1b2aad6ab077ce44c18fc06796d37d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import pytest
import llnl.util.filesystem as fs
import spack.container.images
import spack.main
containerize = spack.main.SpackCommand('containerize')
def test_command(default_config, container_config_dir, capsys):
with capsys.disabled():
with fs.working_dir(container_config_dir):
output = containerize()
assert 'FROM spack/ubuntu-bionic' in output
def test_listing_possible_os():
output = containerize('--list-os')
for expected_os in spack.container.images.all_bootstrap_os():
assert expected_os in output
@pytest.mark.maybeslow
@pytest.mark.requires_executables('git')
def test_bootstrap_phase(minimal_configuration, config_dumper, capsys):
minimal_configuration['spack']['container']['images'] = {
'os': 'amazonlinux:2',
'spack': {
'resolve_sha': True
}
}
spack_yaml_dir = config_dumper(minimal_configuration)
with capsys.disabled():
with fs.working_dir(spack_yaml_dir):
output = containerize()
# Check for the presence of the clone command
assert 'git clone' in output
|