'A sequence of build steps is returned.'

def assert_omnibus_steps(self, distribution=Distribution(name='centos', version='7'), expected_category='Applications/System', expected_package_type=PackageTypes.RPM):

    self.patch(packaging, 'CURRENT_DISTRIBUTION', distribution)
    fake_dependencies = {'python': [Dependency(package='python-dep')], 'node': [Dependency(package='node-dep')], 'docker-plugin': [Dependency(package='docker-plugin-dep')], 'cli': [Dependency(package='cli-dep')]}
    def fake_make_dependencies(package_name, package_version, distribution):
        return fake_dependencies[package_name]
    self.patch(packaging, 'make_dependencies', fake_make_dependencies)
    expected_destination_path = FilePath(self.mktemp())
    target_path = FilePath(self.mktemp())
    flocker_cli_path = target_path.child('flocker-cli')
    flocker_node_path = target_path.child('flocker-node')
    flocker_docker_plugin_path = target_path.child('flocker-docker-plugin')
    flocker_shared_path = target_path.child('flocker-shared')
    empty_path = target_path.child('empty')
    expected_virtualenv_path = FilePath('/opt/flocker')
    expected_prefix = FilePath('/')
    expected_epoch = PACKAGE.EPOCH.value
    expected_package_uri = 'https://www.example.com/foo/Bar-1.2.3.whl'
    expected_package_version_step = GetPackageVersion(virtualenv=VirtualEnv(root=expected_virtualenv_path), package_name='flocker')
    expected_version = DelayedRpmVersion(package_version_step=expected_package_version_step)
    expected_license = PACKAGE.LICENSE.value
    expected_url = PACKAGE.URL.value
    expected_vendor = PACKAGE.VENDOR.value
    expected_maintainer = PACKAGE.MAINTAINER.value
    package_files = FilePath('/package-files')
    virtualenv = VirtualEnv(root=expected_virtualenv_path)
    expected = BuildSequence(steps=(InstallVirtualEnv(virtualenv=virtualenv), InstallApplication(virtualenv=virtualenv, package_uri='-r/flocker/requirements/flocker.txt'), InstallApplication(virtualenv=VirtualEnv(root=expected_virtualenv_path), package_uri='https://www.example.com/foo/Bar-1.2.3.whl'), expected_package_version_step, CreateLinks(links=[(FilePath('/opt/flocker/bin/eliot-prettyprint'), flocker_shared_path), (FilePath('/opt/flocker/bin/eliot-tree'), flocker_shared_path)]), BuildPackage(package_type=expected_package_type, destination_path=expected_destination_path, source_paths={expected_virtualenv_path: expected_virtualenv_path, flocker_shared_path: FilePath('/usr/bin')}, name='clusterhq-python-flocker', prefix=expected_prefix, epoch=expected_epoch, rpm_version=expected_version, license=expected_license, url=expected_url, vendor=expected_vendor, maintainer=expected_maintainer, architecture='native', description=PACKAGE_PYTHON.DESCRIPTION.value, category=expected_category, directories=[expected_virtualenv_path], dependencies=[Dependency(package='python-dep')]), LintPackage(package_type=expected_package_type, destination_path=expected_destination_path, epoch=expected_epoch, rpm_version=expected_version, package='clusterhq-python-flocker', architecture='native'), CreateLinks(links=[(FilePath('/opt/flocker/bin/flocker'), flocker_cli_path), (FilePath('/opt/flocker/bin/flocker-ca'), flocker_cli_path)]), BuildPackage(package_type=expected_package_type, destination_path=expected_destination_path, source_paths={flocker_cli_path: FilePath('/usr/bin')}, name='clusterhq-flocker-cli', prefix=expected_prefix, epoch=expected_epoch, rpm_version=expected_version, license=expected_license, url=expected_url, vendor=expected_vendor, maintainer=expected_maintainer, architecture='all', description=PACKAGE_CLI.DESCRIPTION.value, category=expected_category, dependencies=[Dependency(package='cli-dep')]), LintPackage(package_type=expected_package_type, destination_path=expected_destination_path, epoch=expected_epoch, rpm_version=expected_version, package='clusterhq-flocker-cli', architecture='all'), CreateLinks(links=[(FilePath('/opt/flocker/bin/flocker-volume'), flocker_node_path), (FilePath('/opt/flocker/bin/flocker-control'), flocker_node_path), (FilePath('/opt/flocker/bin/flocker-container-agent'), flocker_node_path), (FilePath('/opt/flocker/bin/flocker-dataset-agent'), flocker_node_path), (FilePath('/opt/flocker/bin/flocker-diagnostics'), flocker_node_path), (FilePath('/opt/flocker/bin/flocker-benchmark'), flocker_node_path), (FilePath('/opt/flocker/bin/flocker-node-era'), flocker_node_path)]), BuildPackage(package_type=expected_package_type, destination_path=expected_destination_path, source_paths={flocker_node_path: FilePath('/usr/sbin'), package_files.child('firewalld-services'): FilePath('/usr/lib/firewalld/services/'), package_files.child('ufw-applications.d'): FilePath('/etc/ufw/applications.d/'), package_files.child('systemd'): FilePath('/usr/lib/systemd/system/'), package_files.child('upstart'): FilePath('/etc/init'), package_files.child('rsyslog'): FilePath('/etc/rsyslog.d'), empty_path: FilePath('/var/lib/flocker/')}, name='clusterhq-flocker-node', prefix=expected_prefix, epoch=expected_epoch, rpm_version=expected_version, license=expected_license, url=expected_url, vendor=expected_vendor, maintainer=expected_maintainer, architecture='all', description=PACKAGE_NODE.DESCRIPTION.value, category=expected_category, dependencies=[Dependency(package='node-dep')], after_install=package_files.child('after-install.sh'), directories=[FilePath('/var/lib/flocker/')]), LintPackage(package_type=expected_package_type, destination_path=expected_destination_path, epoch=expected_epoch, rpm_version=expected_version, package='clusterhq-flocker-node', architecture='all'), CreateLinks(links=[(FilePath('/opt/flocker/bin/flocker-docker-plugin'), flocker_docker_plugin_path)]), BuildPackage(package_type=expected_package_type, destination_path=expected_destination_path, source_paths={flocker_docker_plugin_path: FilePath('/usr/sbin'), package_files.child('docker-plugin').child('systemd'): FilePath('/usr/lib/systemd/system'), package_files.child('docker-plugin').child('upstart'): FilePath('/etc/init')}, name='clusterhq-flocker-docker-plugin', prefix=FilePath('/'), epoch=expected_epoch, rpm_version=expected_version, license=PACKAGE.LICENSE.value, url=PACKAGE.URL.value, vendor=PACKAGE.VENDOR.value, maintainer=PACKAGE.MAINTAINER.value, architecture='all', description=PACKAGE_DOCKER_PLUGIN.DESCRIPTION.value, category=expected_category, dependencies=[Dependency(package='docker-plugin-dep')]), LintPackage(package_type=distribution.package_type(), destination_path=expected_destination_path, epoch=expected_epoch, rpm_version=expected_version, package='clusterhq-flocker-docker-plugin', architecture='all')))
    assert_equal_steps(self, expected, omnibus_package_builder(distribution=distribution, destination_path=expected_destination_path, package_uri=expected_package_uri, target_dir=target_path, package_files=FilePath('/package-files')))
